Adding as many examples as I've converted so far.
This commit is contained in:
6
4 - If Else and Logical Operators/Challenge/README.md
Normal file
6
4 - If Else and Logical Operators/Challenge/README.md
Normal file
@@ -0,0 +1,6 @@
|
||||
Build a program that requests the user's age, and return one of the following:
|
||||
- <= 18 - You're a youngin'
|
||||
- > 18 AND <= 35 - The early adult years
|
||||
- > 35 AND <= 55 - Middle aged, time to buy a really expensive car
|
||||
- > 55 AND <= 64 - Getting older...
|
||||
- > 64 - Retirement! Time to live out the golden years
|
||||
12
4 - If Else and Logical Operators/Challenge/main.py
Normal file
12
4 - If Else and Logical Operators/Challenge/main.py
Normal file
@@ -0,0 +1,12 @@
|
||||
age = int(input("Enter your age: "))
|
||||
|
||||
if age <= 18:
|
||||
print("You're a youngin'")
|
||||
elif age > 18 and age <= 35:
|
||||
print("The early adult years")
|
||||
elif age > 35 and age <= 55:
|
||||
print("Middle aged, time to buy a really expensive car")
|
||||
elif age > 55 and age <= 64:
|
||||
print("Getting older...")
|
||||
else:
|
||||
print("Retirement! Time to live out the golden years.")
|
||||
Reference in New Issue
Block a user