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

27th Feb 2021, 4:01 AM
Liam Wright
Liam Wright - avatar
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.
27th Feb 2021, 4:36 AM
Simba
Simba - avatar
+ 1
Hi. could u share ur code attempt in playground? 🙂
27th Feb 2021, 4:10 AM
arturop200
arturop200 - avatar
0
Liam Wright Just take age as String input because you want to concate with String name = input () age = input ()
27th Feb 2021, 6:17 AM
A͢J
A͢J - avatar