forked from Code-the-Dream-School/python-intro-homework
-
Notifications
You must be signed in to change notification settings - Fork 0
Assignment 3 #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
cabo197950-bit
wants to merge
7
commits into
main
Choose a base branch
from
assignment-3
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Assignment 3 #2
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
badcb09
Add restaurant decision script
cabo197950-bit 490c909
Add assignment 3 control flow exercises
cabo197950-bit ece5b0c
Fix assignment 3 feedback
cabo197950-bit 57f5d98
Rename mini project file and update assignment
cabo197950-bit 9ad34f5
Complete mini project day planner
cabo197950-bit c3f9a5f
Complete mini project day planner
cabo197950-bit 3d5e479
Improve mini project coverage and output formatting
cabo197950-bit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.") | ||
|
|
||
| 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.") | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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}") | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.") |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.