0
nested if else statement
i need more method solve ? # ASK USER NAME + AGE # IF USER NAME START WITH 'A','a' & AGE IS ABOVE 10 #PRINT YOU CAN WATCH THIS MOVIE #ANOTHER YOU CANT WATCH THIS MOVIE i try this my code =============== user_name =input("Enter your name :--") user_age=int(input("ENTER YOUR AGE:--")) #nested if -else use if user_age >10 and (user_name[0] == 'a' or user_name[0] == 'A'): print("you watch this movie") else: print("you cant watch this movie")
2 Antworten
+ 3
name=input("enter name:").lower()
age=int(input("enter age:"))
if age > 10 and name.startswith("a"):
print("watch movie")
else:
print("dont watch movie")