Computer Science

What is the problem with the following code fragment?


name = "Prejith"
age = 26
print ("Your name & age are ", name + age)

Python Funda

28 Likes

Answer

In the print statement we are trying to add name which is a string to age which is an integer. This is an invalid operation in Python.

Answered By

14 Likes


Related Questions