this is my homework:
Write a program that asks for the names and ages of 10 students. Prints the names and ages of the students alphabetically in a table format -- while also identifying the oldest student as the "Team Leader".
And this is what I've done so far. Comments are what I think I'm supposed to do but not sure:
#from tabulate import tabulate
studentNames = []
for i in range(10):
item = input("Please enter a name: ")
if len(item) > 0 and item.isalpha():
studentNames.append(item)
#Something like this?
#print(tabulate(studentNames([[]], headers=['Team Leader', 'Students']))
My teacher didn't teach me tabulate but my research says I need to use it, but I think it's wrong and I don't know how to do it alphabetically. I'm sorry for the bad code, I'm embarrassed to even post it.
Any help would be appreciated. Thank you.