+ 1

Club bouncer help

Getting a line 5 syntax error at name in the if statement age = int(input()) name = input() If age>= 18: print (“Welcome” name) else: print (“Sorry”)

28th Feb 2021, 1:46 AM
Sheena
9 Antworten
+ 4
Put a comma before name
28th Feb 2021, 2:02 AM
David Ashton
David Ashton - avatar
+ 4
print("Enter Your Name:") name = input() print("Enter your age :") age = int(input()) if age >= 18: print("You Are Allowed To Enter!", name) else: print("Sorry? You Are Not Allowed to Enter!", name)
9th Nov 2021, 7:24 AM
Peter Aro
Peter Aro - avatar
+ 2
Answer age = int(input("")) name = input("") if age >= 18: print("Welcome " + name) else: print ("Sorry")
21st Oct 2021, 6:51 PM
Belete Yami Bati
+ 1
you have to create variable for 18 age = int(input("")) name = input(" ") a = int(18) if age>=a: print("Welcome "+name) else: print("Sorry")
10th Nov 2022, 4:08 PM
Lawrence Reyanci Vivek
0
Sheena I guess you forgot to concatenate the strings with a plus sign. Also, 'If' doesn't work.
28th Feb 2021, 1:55 AM
Calvin Thomas
Calvin Thomas - avatar
0
Would be inevitable for me to scream from bottom of my heart "What a rocket science!'
1st Sep 2021, 12:39 PM
国武大介
国武大介 - avatar
0
age = int(input()) name = input() If age>= 18: print (“Welcome” name) else: print (“Sorry”)
19th Nov 2022, 11:31 AM
dechen chezom
0
Use this and it will work. Dont forget that you dont need to put plus between welcome and name, instead put comma. age = int(input()) name = input() # your code goes here if age>= 18: print("Welcome", name) else: print("Sorry")
21st Nov 2022, 8:39 PM
Sebastine
0
This gonna work 😄 try it age = int(input("")) name = input(" ") a = int(18) if age>=a: print("Welcome "+name) else: print("Sorry")
18th Apr 2023, 10:39 PM
🇮🇳Mohammad Iqbal
🇮🇳Mohammad Iqbal - avatar