def write_grades_file(filename, grades): Given a filename and a dictionary in the grades format, write the values in the

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

def write_grades_file(filename, grades): Given a filename and a dictionary in the grades format, write the values in the

Post by answerhappygod »

Def Write Grades File Filename Grades Given A Filename And A Dictionary In The Grades Format Write The Values In The 1
Def Write Grades File Filename Grades Given A Filename And A Dictionary In The Grades Format Write The Values In The 1 (108.9 KiB) Viewed 38 times
Need Coding in Python. Can you please explain the logic using
comments?
def write_grades_file(filename, grades): Given a filename and a dictionary in the grades format, write the values in the given dictionary into the given file. The text file format should be the same as what was used in the read_grades_file function. Note 1: A good way to check your work on these two functions is to try and read a file you've written, and vice versa. Note 2: Make sure not to overwrite any important files like the tester, or the test case files! Examples: Here's a dictionary in the grades format for a student named Alan Turing: {'name': 'Alan Turing', 'pa': [1.0, 0.0, 1.0, 0.0, 1.0), 'lab': [1.0, 1.0, 1.0, 0.0, 1.0), 'zy': (0.0, 0.0, 1.0, 0.0, 1.0), 'midi': 1.0, 'mid2': 0.0, 'final': 1.0) And here is how the output file should look given this input: name, Alan Turing pa, 1.0, 0.0, 1.0, 0.0, 1.0 lab, 1.0, 1.0, 1.0, 0.0, 1.0 zy, 0.0, 0.0, 1.0, 0.0, 1.0 midi, 1.0 mid2, 0.0 final, 1.0
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply