How do I program this output using python?
Here is my starting code. Please do help me fix this. Thank you so much.
-----------------The 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
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 Physics Grade C Grade Math Grade Average Grade 1234567890 Jane Doe New York City 23 90 98 89 92.33 0987654322 John Doe Alexander City 24 89 90 97 92.00