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
kfbmartin
wants to merge
22
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
22 commits
Select commit
Hold shift + click to select a range
c981e33
warmups files
invalid-email-address e8c3550
warmups files
invalid-email-address 02308a4
adding assignment 3 files
invalid-email-address a34c84b
adding friendly message to mini-project
invalid-email-address 4bae462
adding updates suggested by the AI Review.
invalid-email-address bc422d8
adding updates suggested by the AI Review 2.
invalid-email-address 199b846
adding updates suggested by the AI Review 3.
invalid-email-address d4921fd
adding updates suggested by the AI Review 3.
invalid-email-address f650354
adding updates suggested by the AI Review 4.
invalid-email-address d1def7c
adding updates suggested by the AI Review 5.
invalid-email-address 4dfb92f
adding updates suggested by the AI Review 6.
invalid-email-address bdb834a
adding updates suggested by the AI Review 7 adding parity for zero.
invalid-email-address e6c5931
adding updates suggested by the AI Review 7 changing text for enter y…
invalid-email-address 95cf879
adding updates suggested by the AI Review 7 changing text for enter y…
invalid-email-address 8857c92
adding updates suggested by the AI Review 8
invalid-email-address be29fbc
adding updates suggested by the AI Review 9
invalid-email-address c85ac91
adding updates suggested by the AI Review 10
invalid-email-address 9a83076
adding updates suggested by the AI Review 11
invalid-email-address e00257c
adding updates suggested by the AI Review 12
invalid-email-address be501cd
adding updates suggested by the AI Review 13 asking for the user age.
invalid-email-address 2d0f1fe
adding updates suggested by the AI Review 14
invalid-email-address 141f35c
Merge branch 'main' into assignment-3
kfbmartin 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 |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| # git log --oneline output: | ||
| #c981e33 (HEAD -> assignment-2, origin/assignment-2) warmups files | ||
| print("I learn that there is a lot to learn about git and github. I was familiar with both, but I have gaps that need to be addressed. I also learn what the git log command was and the oneline flag does, which show you first lines changes to your git repo") | ||
| #c981e33 (HEAD -> assignment-2, origin/assignment-2) warmups files | ||
| print("I learn that there is a lot to learn about git and github. I was familiar with both, but I have gaps that need to be addressed. I also learn what the git log command was and the oneline flag does, which show you first lines changes to your git repo") |
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 @@ | ||
| .DS_Store |
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,88 @@ | ||
| day = input("What day is it? ").lower() | ||
| timeOfDay = input("What time of day? ").lower() | ||
|
|
||
|
|
||
| if day=="sunday": | ||
| #timeOfDay = input("What time of day? ").lower() | ||
| if(timeOfDay == "morning"): | ||
| print("Suggestion: Good Morning, it's a great time to go for a walk!") | ||
| elif(timeOfDay == "afternoon"): | ||
| print("Suggestion: It's time for lunch.") | ||
| elif(timeOfDay == "evening"): | ||
| print("Suggestion: Good evening, it's time to make dinner!") | ||
| else: | ||
| print(f"Sorry, I don't recognize that time of day. Try: morning, afternoon or evening for the time of day.") | ||
|
|
||
| elif day=="monday": | ||
| #timeOfDay = input("What time of day? ").lower() | ||
| if(timeOfDay =='morning'): | ||
| print("Suggestion: Morning, it's a great time to make Pancakes for Breakfast!") | ||
| elif(timeOfDay == "afternoon"): | ||
| print("Suggestion: Good afternoon, it's a great time to read a book!") | ||
| elif(timeOfDay == "evening"): | ||
| print("Suggestion: Good evening, it's a great time to go to a friend's house.") | ||
| else: | ||
| print(f"Sorry, I don't recognize that time of day. Try: morning, afternoon or evening for the time of day.") | ||
|
|
||
| elif day=="tuesday": | ||
| #timeOfDay = input("What time of day? ").lower() | ||
|
|
||
| if(timeOfDay =='morning'): | ||
| print("Suggestion: Morning, it's a great time to go to a Cafe for Breakfast!") | ||
| elif(timeOfDay == "afternoon"): | ||
| print("Suggestion: Good afternoon, it's a great time to go to lunch!") | ||
| elif(timeOfDay == "evening"): | ||
| print("Suggestion: Good evening, it's a great time to go to the gym!") | ||
| else: | ||
| print(f"Sorry, I don't recognize that time of day. Try: morning, afternoon or evening for the time of day.") | ||
|
|
||
| elif day=="wednesday": | ||
| #timeOfDay = input("What time of day? ").lower() | ||
|
|
||
| if(timeOfDay =='morning'): | ||
| print("Suggestion: Morning, it's a great time to go for a run!") | ||
| elif(timeOfDay == "afternoon"): | ||
| print("Suggestion: Good afternoon, it's a great time to go to the grocery store.") | ||
| elif(timeOfDay == "evening"): | ||
| print("Suggestion: Good evening, it's a great time to a restaurant!") | ||
| else: | ||
| print(f"Sorry, I don't recognize that time of day. Try: morning, afternoon or evening for the time of day.") | ||
|
|
||
| elif day=="thursday": | ||
| #timeOfDay = input("What time of day? ").lower() | ||
|
|
||
| if(timeOfDay =='morning'): | ||
| print("Suggestion: Morning, it's a great time to have coffee!") | ||
| elif(timeOfDay == "afternoon"): | ||
| print("Suggestion: Good afternoon, it's a great time to go to the post office.") | ||
| elif(timeOfDay == "evening"): | ||
| print("Suggestion: Good evening, it's a great time to walk the dog!!") | ||
| else: | ||
| print(f"Sorry, I don't recognize that time of day. Try: morning, afternoon or evening for the time of day.") | ||
|
|
||
| elif day=="friday": | ||
| #timeOfDay = input("What time of day? ").lower() | ||
|
|
||
| if(timeOfDay =='morning'): | ||
| print("Suggestion: Morning, it's a great time to exercise!") | ||
| elif(timeOfDay == "afternoon"): | ||
| print("Suggestion: Good afternoon, it's a great time to play Ping Pong.") | ||
| elif(timeOfDay == "evening"): | ||
| print("Suggestion: Good evening, it's a great time to watch TV!") | ||
| else: | ||
| print(f"Sorry, I don't recognize that time of day. Try: morning, afternoon or evening for the time of day.") | ||
|
|
||
| elif day=="saturday": | ||
| #timeOfDay = input("What time of day? ").lower() | ||
|
|
||
| if(timeOfDay =='morning'): | ||
| print("Suggestion: Morning, it's a great time watch the news!") | ||
| elif(timeOfDay == "afternoon"): | ||
| print("Suggestion: Good afternoon, it's a great time to go for Ice Cream!") | ||
| elif(timeOfDay == "evening"): | ||
| print("Suggestion: Good evening, it's a great time to watch a movie!") | ||
| else: | ||
| print(f"Sorry, I don't recognize that time of day. Try: morning, afternoon or evening for the time of day.") | ||
| else: | ||
| print("Sorry, I don't recognize that day. Try: Monday, Tuesday, 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,19 @@ | ||
| #score = int(input("Pick any number between 0 and 100: ")) | ||
|
|
||
| score = 54 | ||
|
|
||
| if score >= 90 and score <=100: | ||
| print(f"Score: {score}") | ||
| print("Grade: A") | ||
| elif score >= 80 and score <=89: | ||
| print(f"Score: {score}") | ||
| print("Grade: B") | ||
| elif score >= 70 and score <=79: | ||
| print(f"Score: {score}") | ||
| print("Grade: C") | ||
| elif score >= 60 and score <=69: | ||
| print(f"Score: {score}") | ||
| print("Grade: D") | ||
| elif score >= 0 and score <=59: | ||
| print(f"Score: {score}") | ||
| print("Grade: F") |
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 @@ | ||
| age = int(input("Enter your age:")) | ||
|
|
||
| if age>=0 and age<=12: | ||
| #print(f"Your age is {age}.") | ||
| print("You are a Child.") | ||
| elif age>=13 and age<=17: | ||
| #print(f"Your age is {age}.") | ||
| print("You are a Teen.") | ||
| elif age>=18 and age<=64: | ||
| #print(f"Your age is {age}.") | ||
| print("You are an Adult.") | ||
| elif age>=65: | ||
| #print(f"Your age is {age}.") | ||
| print("You are a Senior.") | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. consider adding an |
||
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,5 @@ | ||
| print(not True and False) #not True is False; False and False is False | ||
| print(True or False and False) # False is False is False; True or False is True; | ||
| print(not (5 > 3)) # 5 is greater than 3 which is True; Not True is False | ||
| print(10 == 10 and 4 != 4) # 10==10 is True; and 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,24 @@ | ||
| number = int(input("Enter a number: ")) | ||
|
|
||
| # if/elif/else statement 1 for sign | ||
|
|
||
| if number>0: | ||
| print(f"{number} is positive.") | ||
|
|
||
| elif number< 0: | ||
| print(f"{number} is negative.") | ||
|
|
||
| else: | ||
| print(f"{number} is zero.") | ||
|
|
||
|
|
||
| # if/elif/else statement 2 for parity including zero | ||
|
|
||
| if number % 2 == 0: | ||
| print(f"{number} is even.") | ||
|
|
||
| elif number %2 !=0: | ||
| print(f"{number} is odd.") | ||
|
|
||
| else: | ||
| print(f"{number} is even.") |
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.
Solid work! I think this meets the requirements fine, but as a thought exercise, think about other ways you might branch the validation so less code has to run before the user gets an error message.
Also side note, in python it's customary to name variables in snake_case instead of camelCase. so
time_of_dayinstead oftimeOfDay.