Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python) Write a function print_student_grader_pairs(pairs) that takes a single parameter: a list of student-grader pairs, like the output from the previous part. This function should
Python) Write a function print_student_grader_pairs(pairs) that takes a single parameter: a list of student-grader pairs, like the output from the previous part. This function should print a line for each pair in the list. For example, the previous output might display
s1 will be graded by g2 s2 will be graded by g2 s3 will be graded by g1 I wrote the following function that allows me to take in user input in the form of a list and pair students randomly with graders. I am having difficulty in referencing the output of the below function into a new print_student_grader_pairs(pairs) function. #Function that prepares a list of assigned graders. Need to refer to the ouput of this function. def assign_graders(students, graders): import random pairs = [] for student in students: pairs.append((student, graders[random.randint(0,len(graders)-1)])) print(f"Pairs: {pairs}") #Obtain user input to input into function argument student_input = input("Please enter list of student's names separated by a comma: ") grader_input = input("Please enter a list of grader's names separated by a comma: ") #Create the lists for students and grader students = student_input.split(", ") graders = grader_input.split(", ") #test print statements print("Students: ", students) print("Graders: ", graders) #function call assign_graders(students, graders)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started