Professional Documents
Culture Documents
Question 3
3.1
num = int(input("Enter the number of the package: "))
retail = 99
amount = num * retail
3.2
for i in range(1, 9):
for j in range(1, i+1):
print("* ", end="")
print()
3.3
score = []
sum = 0
for i in range(5):
score.append(float(input("Enter score " + str(i+1) + ": ")))
sum += score[i]
print("---Test Scores---")
for j in range(5):
if 0 <= score[j] <= 49:
print("score " + str(j+1) + ": " + str(score[j]) + "\t" + "Grade: F")
elif 50 <= score[j] <= 59:
print("score " + str(j+1) + ": " + str(score[j]) + "\t" + "Grade: D")
elif 60 <= score[j] <= 69:
print("score " + str(j+1) + ": " + str(score[j]) + "\t" + "Grade: C")
elif 70 <= score[j] <= 79:
print("score " + str(j+1) + ": " + str(score[j]) + "\t" + "Grade: B")
elif 80 <= score[j] <= 100:
print("score " + str(j+1) + ": " + str(score[j]) + "\t" + "Grade: A")
print("Average score: " + str(sum/5))