diff --git a/week-3/assignment-3/mini_project.py b/week-3/assignment-3/mini_project.py new file mode 100644 index 0000000..733802f --- /dev/null +++ b/week-3/assignment-3/mini_project.py @@ -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.") + +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.") + \ No newline at end of file diff --git a/week-3/assignment-3/restaurant.py b/week-3/assignment-3/restaurant.py new file mode 100644 index 0000000..173cdcd --- /dev/null +++ b/week-3/assignment-3/restaurant.py @@ -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.") \ No newline at end of file diff --git a/week-3/assignment-3/warmup1.py b/week-3/assignment-3/warmup1.py new file mode 100644 index 0000000..69833f8 --- /dev/null +++ b/week-3/assignment-3/warmup1.py @@ -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}") + + diff --git a/week-3/assignment-3/warmup2.py b/week-3/assignment-3/warmup2.py new file mode 100644 index 0000000..62e2110 --- /dev/null +++ b/week-3/assignment-3/warmup2.py @@ -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.") \ No newline at end of file diff --git a/week-3/assignment-3/warmup3.py b/week-3/assignment-3/warmup3.py new file mode 100644 index 0000000..9461cd7 --- /dev/null +++ b/week-3/assignment-3/warmup3.py @@ -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 \ No newline at end of file diff --git a/week-3/assignment-3/warmup4.py b/week-3/assignment-3/warmup4.py new file mode 100644 index 0000000..457ca6c --- /dev/null +++ b/week-3/assignment-3/warmup4.py @@ -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.") \ No newline at end of file