Printing an input that is not int() | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Printing an input that is not int()

I am trying to get an input of a name and print it with a general statement. age = input(int()) name = input() if age >= 21: print("Welcome " name) else: print("Sorry") this is what I have and it keeps coming up with a syntax at name in the code

9th Sep 2021, 7:10 PM
Clayton Gardenhire
3 Answers
+ 3
The error is actually in the first line. It should be age = int(input())
9th Sep 2021, 7:15 PM
Simon Sauter
Simon Sauter - avatar
+ 3
And your first print statement is missing a plus sign.
9th Sep 2021, 7:16 PM
Simon Sauter
Simon Sauter - avatar
+ 1
thank you
9th Sep 2021, 8:17 PM
Clayton Gardenhire