-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlegal_ages_python.py
More file actions
42 lines (28 loc) · 946 Bytes
/
legal_ages_python.py
File metadata and controls
42 lines (28 loc) · 946 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
while True:
import sys
print("please enter your age")
age = int(input())
# - You can vote
if age < 18:
print("you are too young to vote")
elif age >= 18:
print("you are old enough to vote")
# - You can driver
if age < 16:
print("you are too young to drive")
elif age >= 16:
print("you are old enough to drive")
# - you can't leagally drink but your mates/uncles might have your back (bigger 16)
if age >= 18:
print("you can drink until the cows come home")
elif age < 18 & age > 16:
print("you cannot legally drink, but your mates and uncles will sort you out")
else:
print("go home to your mommy")
# - Your too young, go back to school!
if age < 16:
print("go back to school")
userInput = input("Enter 'R' to restart or 'X' to exit").capitalize()
if userInput == "X":
print('Goodbye.')
sys.exit(-1)