HOMEWORK:
Part 1:
Use if-elif-else statements to create a grading system where a user inputs a percent grade (0 to 100).
if 100-90 = A
else if 89-80 = B
and so on
Part 2:
Use a while loop to print a pattern starting from 1 and ending at 46 where the difference between terms increases by 1:
1, 2, 4, 7, 11, 16, 22, 29, 37, 47
Hint: You will need 2 different variables. One of them will be the number you print and the other will be the amount you add.
RESOURCES:
Class slides: https://docs.google.com/presentation/d/1UlxFWDgPrOBy-5pybRom5_nRyehCyvPIN2n3mc3Sgkw/edit?usp=sharing
Example code: https://replit.com/@ShravyaS/IntroToPython-Wk2Day1
Coding platform: replit.com
LOL Discord: https://discord.gg/dWVUBmPx
Post your answers as a comment! I will post the solution before next class.
You can always email us at shravyassathish@gmail.com (mentor) or kingericwu@gmail.com (TA) or message us on Discord if you have any questions about the homework or what we covered in class.
grade = int(input("Did you pass your most recent test? Enter your score here: "))
if grade >= 90:
print("A: You are sooo smart!")
elif grade >= 80:
print("B: You're getting there!")
elif grade >= 70:
print("C: Nice try!")
elif grade >= 60:
print("D: There's always next time!")
else:
print("F: Ummm... You know what? Just forget it. I'm running out of positives, let's make this quick. You've graduated school!!!")
x = 1
y = 0
while y <= 10:
print(x)
y += 1
x += y
I finally figured out how to do this pattern
It's a little late, but at least I did it