Home > Back-end >  How can I get my 2d list to print after calling the function? in Python
How can I get my 2d list to print after calling the function? in Python

Time:10-11

I've already ran the program a few times and adjusted a few things but its still not outputting the 2d list after answering input questions. Here is my code so far:

def input_test_scores():
    n_students = int(input('The number of students: '))
    n_tests = int(input('The number of tests for each student: '))
    test_scores_list = []
    for student in range(n_students):
        print('Student', student   1)
        student_list = []
        for tests in range(n_tests):
            print(f'Enter score for test {tests   1}:')
            student_list.append(int(input()))
        test_scores_list.append(student_list)
    return test_scores_list


input_test_scores()

CodePudding user response:

I might not understand correctly but isn't it just print(input_test_scores()) at the end?

  • Related