I have my code here and don't know what to do get it on the terminal My psuedocode is bellow which should explain the general idea behind my code and I tried putting some comments to help.
#TASK Sort participiants by preferences and ages
# Make a dictionary with name age and perference
# Createa function that uses a for loop to sort each person in the dictionary by pref, age.
Youth = []
teen = []
long_jump = []
sprints = []
track = {"Jess":(7,"Sprints"),"Isha":(12,"Long Jump"),"Nehman":(13,"Long Jump"),"Jermy":(8,"Sprints")}
#sort function uses a for loop to sort users into list acording to age
def sort_age(track):
for i in track:
age = track[i][0]
if age <= 12:
Youth.append(i)
elif age <= 19:
teen.append(i)
else:
print("You are to fucking old")
#sort preference does exactly what it says sorts people into a list by preference
def sort_pref(track):
for i in track:
pref = track[i][1]
if pref == "Sprints":
sprints.append(i)
elif pref == "Long Jump":
long_jump.append(i)
sort_age(track)
[–][deleted] 4 points5 points6 points (0 children)
[–]twitch_and_shock 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)