[Solved]-Pythonimport Randomimport Libstudent Stufilepath Data Studentscsv Colfirstname 0collastna Q37221747
Pythonimport randomimport lib.Student as stuFILE_PATH = “./data/students.csv”COL_FIRST_NAME = 0COL_LAST_NAME = 1COL_ID = 2COL_FLAG = 3NUM_STUDENT_PRESENT = 9NUM_DAYS = 3def main(): for presentation_day in range(NUM_DAYS): print(“Presentation Day %s” % (presentation_day + 1)) # Q1 # Call a function to create a dictionary containing Student Class instances. # The dictionary should contain students who have not presented yet. # YOUR ANSWER HERE! # an empty dictionary to store Student instances with a presented flag presented = {} counter = 0 while bool(students) and counter < NUM_STUDENT_PRESENT: # randomly pick one key from the list of dictionary keys key = random.choice(list(students.keys())) # get a Student instance based on the randomly picked key s = students[key] print(“%s %s” % (counter+1, s.print_status())) #Q2 # Call a method to update the student’s presented status to True # YOUR ANSWER HERE! presented[key] = s del students[key] counter+=1 # Q3 # Call a function to update student presented status on the CSV file # by feeding a dictionary object containing students with a presented flag # YOUR ANSWER HERE! # Reset all “presented flags” on the input CSV file stu.reset_flag_file(FILE_PATH, COL_FLAG)if __name__ == ‘__main__’: main()
Expert Answer
Answer to Python import random import lib.Student as stu FILE_PATH = “./data/students.csv” COL_FIRST_NAME = 0 COL_LAST_NAME = 1 C… . . .
OR

