Categories
Ask Development Programming & Design

[ Programming & Design ] Open Question : I need help with my Python program?

num_grades = int(input(“How many grades do you expect? “))

if num_grades > 0:
namelist = []
scorelist = []
gradelist = []
for ng in range(1, num_grades + 1):
name = input(‘What is your name? ‘)
namelist.append(name)
score = float(input(‘What is your score? ‘))
scorelist.append(score)
if score >= 70:
gradelist.append(“P”)
else:
gradelist.append(“F”)

students_fail = 0
students_pass = 0

for PorF in gradelist:
if gradelist == “P”:
print(namelist, scorelist, gradelist, ‘Pass’)
else:
print(namelist, scorelist, gradelist, ‘Fail’)

My current problem is that when I get a lower grade then 70 the whole program runs to the end, however if my score is 70 or higher for some reason the last part of my program does not execute at all? Can anybody help me out?

Leave a Reply

Your email address will not be published. Required fields are marked *