#---------------------------------------------------------------------- # Program to print out student performance. # Intermediate Version # # Copyright (C) February 2, 2018 -- Dr. William T. Verts # # Rather than have an explicit if-network such as: # if # else # if # else # if # else... # Python allows us to join the else and the if into elif (else-if), # keeping the indentation the same at all levels. #---------------------------------------------------------------------- def Student (Name,Grade): S = "" # BarGraph Counter = 0 while (Counter < Grade): S = S + "|" Counter = Counter + 1 # Name and Grade S = S + " " + Name # Grade S = S + " " + str(Grade) # Letter Grade if (Grade >= 90): S = S + " A" elif (Grade >= 80): S = S + " B" elif (Grade >= 70): S = S + " C" elif (Grade >= 60): S = S + " D" else: S = S + " F" print S return Student("Fred",76) Student("Sam",23) Student("Mary",92)