Python Variable Subtracting and If/Else statements
Go to solution
Solved by reniat,
instead of = < do <= for less than or equal to
Also, make sure to indent the lines in the if and else statement since python uses indentation to structure logic:
if current_year - int(patron_year) <= alchohol_consumtion_age: print("Tsk, Tsk, no alcohol for you") else: print("It's Beer O'Clock, my dude or dudette")
-
Featured Topics
-
Topics
-
2
-
0
-
0
-
Sirin ·
Posted in Storage Devices0 -
0
-
Nicktheflick ·
Posted in CPUs, Motherboards, and Memory8 -
15
-
0
-
creat0r ·
Posted in Programming4 -
Rakeboy77 ·
Posted in Troubleshooting7
-
-
play_circle_filled
Latest From ShortCircuit:
I tried 20 influencer foods, here are the best… and the worst…
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now