name age print(name + " is " + age + " years old") | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

name age print(name + " is " + age + " years old")

30th Nov 2022, 2:08 PM
AxenTzy.
AxenTzy. - avatar
2 Answers
+ 6
AxenTzy. , i suppose that your question is related to the tutorial *python for beginners* lesson exercise 17.2. it would be very helpful if you could publish the required information in the future. Anonymous , codes that are used for code coach exercises in sololearn can not have any text prompt inside the input() function. so your code suggestion will not pass the test cases. in addition, the code contains 2 errors: > missing closing parenthesis at the end of line 2 > string and integer can not be concatenated in line 3 ? you have not been running your code suggestion - right ?
30th Nov 2022, 4:43 PM
Lothar
Lothar - avatar
+ 1
name = input("Enter your name:") age = int(input("Enter your age:") print(name + " is " + age + " years old") AxenTzy. This is proper code.
30th Nov 2022, 2:12 PM
Anonymous
Anonymous - avatar