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
8 changes: 8 additions & 0 deletions week-2/assignment-2/mini_project.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
fahrenheit = float(input("Enter a temperature in Fahrenheit:"))

celcius = (fahrenheit - 32) * 5 / 9

print(f'{fahrenheit:.1f}°F is {celcius:.1f}°C.')



3 changes: 3 additions & 0 deletions week-2/assignment-2/warmup1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
print ('Python is working!')


10 changes: 10 additions & 0 deletions week-2/assignment-2/warmup2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#navigations commands I used:
# cd python-intro-homework
#ls
#cd week-2
#cd assignment-2
#pwd


date = input("What is today's date? ")
print(f'You said today is {date}.')
7 changes: 7 additions & 0 deletions week-2/assignment-2/warmup3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# git log --oneline output:
# 194c8fa add warmup2.py
# 294742d add week 2 folder
# 58d836d Add files via upload
# d8c0c05 Update README.md

print("This week I learned how to use Python input, work with strings, and run Git commands in the terminal!")
16 changes: 16 additions & 0 deletions week-2/assignment-2/warmup4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

# 1. What the error message said:
# NameError: name 'naame' is not defined. Did you mean: 'name'?

#2. What caused it:
# I misspelled the variable name as 'naame' inside the print statement
# and forgot to include input() on line 1, so Python didn't know what 'naame' was.

#3. How I fixed it:
# I added input() to line 1 to capture the user's input and corrected
# the spelling of the variable to 'name' in the print statement.'''

# Fixed, working code:

name = input("What is your name? ")
print(f"Your name is {name}.")
33 changes: 33 additions & 0 deletions week-3/assignment-3/mini_project.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
day = input('Please enter a day of the week: ').strip().lower()
time_of_day = input("Please enter a time of day (morning, afternoon, or evening): ").strip().lower()

if day == "monday":
if time_of_day == "morning":
print("Activity: Go for an early morning walk!! ")
elif time_of_day == "afternoon":
print('Activity: Make yourself a yummy snack!! ')
elif time_of_day == "evening":
print('Activity: Make yourself a yummy and healthy dinner')
else:
print('Invalid time of day')
elif day == "saturday":
if time_of_day == "morning":
print('Activity: Make yourself a nice cup of coffee to start your day!!')
elif time_of_day == "afternoon":
print('Activity: Spend your afternoon in a park or somewhere outdoors')
elif time_of_day == "evening":
print('Activity: Go and have nice dinner with a special someone')
else:
print('Invalid time of day')
elif day == "sunday":
if time_of_day == "morning":
print('Activity: Visit a local farmers market!!')
elif time_of_day == "afternoon":
print('Activity: Visit family or friends')
elif time_of_day == "evening":
print('Activity: Movie night!!')
else:
print('Invalid time of day')
else:
print('Invalid day of the week. Please choose Monday, Saturday, or Sunday!')

20 changes: 20 additions & 0 deletions week-3/assignment-3/warmup1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
score = 100
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}')






13 changes: 13 additions & 0 deletions week-3/assignment-3/warmup2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
age = int(input('What is 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')

14 changes: 14 additions & 0 deletions week-3/assignment-3/warmup3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 'not True' is False and since one side is False False and False gives False
print(not True and False)

# 'True or False' only needs one to ne True so it gives True
print(True or False and False)

# 5 is greater than 3 so thats True and adding not flips True to False so its False.
print(not (5 > 3))

# 10 equals 10 is true, but 4 not equal to 4 is False. Both arent True 'and' gives False
print(10 == 10 and 4 != 4)

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

if number > 0:
print(f'{number} is positive.')
elif number < 0:
print(f'{number} is negative.')
else:
print(f'{number} is zero. ')



if number % 2 == 0:
print(f'{number} is even. ')

else:
print(f'{number} is odd.')