How do I program this output using python? Here is my starting code. Please help me fix it. Thank you. ---- XXXXXXXXXXcode------------------------------- def SPACES_COUNTER (name): name counter_len =...


How do I program this output using python?



Here is my starting code. Please help me fix it. Thank you.


------------------------code-------------------------------


def SPACES_COUNTER (name):
    name

    counter_len = 0
    name_len = []


    while (counter_len <>
        for i in range (counter_len):
            name_len.append(len(name[i]))
        counter_len += 1

    return max(name_len)


stud_id = []
name = []
address = []
age = []


num_of_records = int(input("Enter number of records: "))
counter=0
while (counter<>
    for i in range(num_of_records):
        stud_id_input = input("Enter Student ID: ")
        stud_id.append(stud_id_input)
        name_input = input('Enter Name: ')
        name.append(name_input)
        address_input = input('Enter address: ')
        address.append(address_input)
        age_input = int(input("Enter Age: "))
        age.append(age_input)

        counter += 1

name_spaces = SPACES_COUNTER(name)
student_spaces = SPACES_COUNTER(stud_id)
address_spaces = SPACES_COUNTER(address)


counter_disp = 0
while (counter_disp <>
    print("Student ID "+' '* (student_spaces-8) + "Name"+' ' * (name_spaces-1) + "Address" +' ' * (address_spaces - 1)+ "Age")
    for i in range (num_of_records):

        print(stud_id[i],' ' *(student_spaces - len(stud_id[i])+1) , name[i],' '*(name_spaces-len(name[i])+1), address[i],' '*(address_spaces - len(address[i])),'\t', age[i])
        counter_disp += 1



Expected Output:<br>Enter number of records: 2<br>Enter Student ID: 1234567890<br>Enter Name: Jane Doe<br>Enter address: New York City<br>Enter Age: 23<br>Enter Physics marks in 1st semester: 90<br>Enter C marks in 1st semester: 98<br>Enter Math marks in 1st semester: 89<br>Enter Student ID: 0987654322<br>Enter Name: John Doe<br>Enter address: Alexander City<br>Enter Age: 24<br>Enter Physics marks in 1st semester: 89<br>Enter C marks in 1st semester: 90<br>Enter Math marks in 1st semester: 97<br>Student ID<br>Name<br>Address<br>Age<br>1234567890<br>Jane Doe<br>New York City<br>23<br>C Grade<br>Average Grade<br>92.33<br>Physics Grade<br>Math Grade<br>90<br>98<br>89<br>Student ID<br>Name<br>Address<br>Age<br>0987654322<br>John Doe<br>Alexander City<br>24<br>Physics Grade<br>C Grade<br>Math Grade<br>Average Grade<br>89<br>90<br>97<br>92.00<br>

Extracted text: Expected Output: Enter number of records: 2 Enter Student ID: 1234567890 Enter Name: Jane Doe Enter address: New York City Enter Age: 23 Enter Physics marks in 1st semester: 90 Enter C marks in 1st semester: 98 Enter Math marks in 1st semester: 89 Enter Student ID: 0987654322 Enter Name: John Doe Enter address: Alexander City Enter Age: 24 Enter Physics marks in 1st semester: 89 Enter C marks in 1st semester: 90 Enter Math marks in 1st semester: 97 Student ID Name Address Age 1234567890 Jane Doe New York City 23 C Grade Average Grade 92.33 Physics Grade Math Grade 90 98 89 Student ID Name Address Age 0987654322 John Doe Alexander City 24 Physics Grade C Grade Math Grade Average Grade 89 90 97 92.00

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here