0
Why 0 in front of name variable output?
https://sololearn.com/coach/1032/?ref=app I cannot for the life of me determine why there is a zero in front of the name output name = input() age = input(int()) print(name + " is " + age + " years old") Results = Inputs Dave 22 Output: 0Dave is 22 years old Expected: Dave is 22 years old
3 Respostas
+ 6
Because the format is age = int(input) not input(int).
Also, you have to use "," instead of "+" or str() function to add integers to strings.
+ 1
Hi. could u share ur code attempt in playground? 🙂
0
Liam Wright
Just take age as String input because you want to concate with String
name = input ()
age = input ()