![]() I tried to solve the 4th and 5th choice which is getting the overall topper and subject-wise topper in a text file and printing the students with their decreasing percentage in another file but I didn't get it. Write a function searchRollNo( r ) in Python which accepts the. Students with percentage in decreasing order''') Write a user defined function insertRec() to input data for a student and add to student.dat. Hint: Use the format specification to set the precision of the output.īarrett Edan 70 45 59 Bradshaw Reagan 96 97 88 Charlton Caius 73 94 80 Mayo Tyrese 88 61 36 Stern Brenda 90 86 45īarrett Edan 70 45 59 F Bradshaw Reagan 96 97 88 A Charlton Caius 73 94 80 B Mayo Tyrese 88 61 36 D Stern Brenda 90 86 45 C Averages: midterm1 83.40, midterm2 76.60, final 61.4. def gradesaverage (grades): return sum (grades) / float (len (grades)) Also, you do not need to cast len (grades) to float if you are using Python 3. This completely negates your need for gradessum (scores).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |