Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions week-3/assignment-3/mini_project.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Mini Project - Day Planner

day = input("What day is it? ").strip().lower()
time_of_day = input("What time of day? ").strip().lower()

if day == "monday":
if time_of_day == "morning":
print("Suggestion: Go for a morning walk.")
elif time_of_day == "afternoon":
print("Suggestion: Practice Python coding.")
elif time_of_day == "evening":
print("Suggestion: Cook a healthy dinner.")
else:
print("Sorry, I don't recognize that time of day.")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to make the error message helpful! Or put the choices (morning/afternoon/evening) in the prompt.


elif day == "tuesday":
if time_of_day == "morning":
print("Suggestion: Plan your goals for the day.")
elif time_of_day == "afternoon":
print("Suggestion: Take a short break outside.")
elif time_of_day == "evening":
print("Suggestion: Read a book and relax.")
else:
print("Sorry, I don't recognize that time of day.")

elif day == "wednesday":
if time_of_day == "morning":
print("Suggestion: Start the day with exercise.")
elif time_of_day == "afternoon":
print("Suggestion: Finish an important project.")
elif time_of_day == "evening":
print("Suggestion: Watch a movie and unwind.")
else:
print("Sorry, I don't recognize that time of day.")

else:
print("Sorry, I don't recognize that day. Try Monday, Tuesday, or Wednesday.")

11 changes: 11 additions & 0 deletions week-3/assignment-3/restaurant.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
food = input("What type of food do you want? ").lower()
budget = input("Do you want a cheap meal? (yes/no): ").lower()

if food == "pizza" and budget == "yes":
print("You should try a budget-friendly pizza place.")
elif food == "pizza":
print("You should try a nicer pizza restaurant.")
elif food == "burger":
print("You should try a burger restaurant.")
else:
print("You should try a local restaurant.")
19 changes: 19 additions & 0 deletions week-3/assignment-3/warmup1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Warmup 1 - Letter Grades

score = 84

if score >= 90:
grade = "A"
elif score >= 80:
grade = "B"
elif score >= 70:
grade = "C"
elif score >= 60:
grade = "D"
else:
grade = "F"

print(f"Score: {score}")
print(f"Grade: {grade}")


14 changes: 14 additions & 0 deletions week-3/assignment-3/warmup2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Warmup2.py age

age = int(input("Enter your age: "))

if age >= 0 and age <= 12:
print("You are a Child.")
elif age >= 13 and age <= 17:
print("You are a Teen.")
elif age >= 18 and age <= 64:
print("You are an Adult.")
elif age >= 65:
print("You are a Senior.")
else:
print("Invalid age.")
16 changes: 16 additions & 0 deletions week-3/assignment-3/warmup3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Warmup 3 - Boolean Expression Practice

print(not True and False)
# not True is False; False and False is False

print(True or False and False)
# False and False is False; True or False is True

print(not (5 > 3))
# 5 > 3 is True; not True is False

print(10 == 10 and 4 != 4)
# 10 == 10 is True; 4 != 4 is False; True and False is False

print(not False or not True)
# not False is True; not True is False; True or False is True
15 changes: 15 additions & 0 deletions week-3/assignment-3/warmup4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
number = int(input("Enter a number: "))

# Sign check
if number > 0:
print(f"{number} is positive.")
elif number < 0:
print(f"{number} is negative.")
else:
print(f"{number} is zero.")

# Parity check
if number % 2 == 0:
print(f"{number} is even.")
else:
print(f"{number} is odd.")