Question: How do I fix unsupported format string passed to nonetype.__format__ here is my code: #globals name_list = [] #keeps tracks of names score_list = []

How do I fix unsupported format string passed to nonetype.__format__ 

How do I fix unsupported format string passed to nonetype.__format__ here is

here is my code:

#globals

name_list = [] #keeps tracks of names

score_list = [] #keeps track of scores

status_list = [] #tracks grade_basis

grade_list = [] #tracks grades based on the status_list

def is_valid_graded(grade_basis): #validation bool

return grade_basis == 1 or grade_basis == 0

def is_valid_score(score): #in range 0...100 validation bool

return score >=0 and score

def compute_grade(score): #computes grades based on score and return grade

if score > 80:

grade = 'A'

else:

grade = 'B'

return grade

def compute_passfail(score,grade_basis):

if grade_basis == 1:

return compute_grade(score)

if score >=40:

grade = "Pass"

else:

grade = "Fail"

def submit():

global name_list, score_list, status_list, grade_list

name = input('Enter name?>>')

score = int(input('Enter a score?>>'))

if not is_valid_score(score):

print('Score must be positive')

grade_basis = int(input('Enter 1 for graded, 0 for pass/fail >>'))

if not is_valid_graded(grade_basis):

print('Enter 1 for graded, 0 for pass/fail')

return

grade = compute_passfail(score,grade_basis)

name_list.append(name)

score_list.append(score)

if grade_basis == 1:

status_list.append("Graded")

else:

status_list.append("PassFail")

grade_list.append(grade)

print(f'Name:{name} Score:{score:.2f}')

def compute_average_score():

global score_list

total_score = 0.0

num_inputs = 0

for score in score_list:

total_score = total_score + score

num_inputs = num_inputs + 1

if num_inputs > 0:

avg = total_score / num_inputs

else:

avg = None

return avg, num_inputs

def summary():

average_score, num_inputs = compute_average_score()

if average_score is not None:

print(f'Average Score: {average_score:.2f}\tNumber of Inputs {num_inputs:d}')

else:

print('No Inputs to compute with!')

def clear_lists():

global score_list, name_list, status_list, grade_list

score_list.clear()

name_list.clear()

status_list.clear()

grade_list.clear()

def reset():

clear_lists()

def line():

print('-'* 55)

def display():

global score_list,name_list,status_list, grade_list

if score_list: #strings, and things, when empty, are False.

line()

print(f'|{"Name":^12s}|{"Score":^12s}|{"Status":^14s}|{"Grade":^12s}|')

line()

for name,score,status,grade in zip(name_list, score_list, status_list,grade_list):

print(f'|{name:12}|{score:12}|{status:14}|{grade:12}|')

line()

else:

print('No Data!')

quit = False

while not quit:

print('1.Submit 2.Summary 3.Reset 4.Display 5.Exit')

choice = int(input('Enter choice: '))

if choice == 1:

submit()

elif choice == 2:

summary()

elif choice == 3:

reset()

print('Now ready for new series')

elif choice == 4:

display()

elif choice == 5:

clear_lists()

quit = True

else:

print('Invalid Choice!')

DEBUG CONSOLE PROBLEMS 6 OUTPUT TERMINAL 2: Python Enter choice: 4 | Name Score Status T Grade Moe 85 Graded A Traceback (most recent call last): File "u:/IS 320/HW5Q2.py", line 145, in display) File "u:/IS 320/HW5Q2.py", line 119, in display print(f"|{name: 12}|{score:12}|{status:14}|{grade: 12}|'). TypeError: unsupported format string passed to NoneType._format__ PS U:\IS 320

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!