0
print("hello") x=input(" what is your name ") y=(len(x)) z=input(" what is your age ") s=str(y+z) print(s)
this program give me error.. I don't find problem.. any Methmetics is not happening in this program..
2 odpowiedzi
+ 5
by default input() return a string
so z is already of string type
two solution to your problem
#first:
z = int ( input(" what is your age"))
s = str(y+ z)
''' this will add length to the age and then convert it to the string, addition of numbers'''
#second:
s = str(y) + z
''' in this z will remain in string type, we just have to convert y, this will result in length of name followed by the age, append two string'''
Edit:
as your question doesn't clarify what do you want to do? gave you both the solution, choose according to your need.
+ 2
Please post a topic like "Help with code please" and then put all the details within the question.