0
Write a program to control entrance to a club. Only people who are 18 or older are allowed to enter the club. Your program take
the age of the person who tries to enter, and outputs "Allowed" if they are allowed to enter the club, and "Sorry" if they are younger than the allowed age. Sample Input 24 Sample Output Allowed
7 Antworten
+ 5
age = int(input())
name = input()
# your code goes here
if age >= 18 :
print("Welcome " + name)
else :
print("Sorry")
+ 1
print("Allowed"if int(input())>17 else"Sorry")
+ 1
age = int(input())
if age >= 18 :
print("Allowed")
else :
print("Sorry")
This is the answer.. Dont Forget to space if statement
+ 1
age=int(input())
#your code goes here
if age>18:
#if age is greater than or equal to 18 then allowed
print("Allowed")
#*note*:don't forget phyton is case sensitive language.you should define upper_chars variable inside the function.
else:
#otherwise say sorry
print("Sorry")
+ 1
Bro I tried all of the above and it doesn't work
0
age = int(input())
if age >= 18:
print("Allowed")
else:
print("sorry")
- 2
I dont know but i know there is need to use else i think this will help you
age = 16
only = 18
if (age < only)
print("Allowed")
else {
print("Not allowed")
}
its just example so dont dislike
Edit:output is Not allowed