Selecting a position from a lists using Python -
i want create program selects team lists , display players name , postion.
something this:
enter team: enter position number: 1
then should print this:
at postion 1 john
this got far:
def display_team(teamnum, team): print "team" + teamnum + ": " player in team: print player #main #lists used define teams teama = ["john", "peter", "philip", "ben"] teamb = ["bill", "tommy", "pete", "manny"] display_team('a', 'teama') display_team('b', 'teamb') team = raw_input("enter team: ") position = int(raw_input("enter position:")) raw_input("\npress enter continue")
add end of code :
if 'a' team: print 'team a\n', 'at position ', position , teama[position - 1] if 'b' team: print 'team b\n', 'at position ', position , teamb[position - 1]
Comments
Post a Comment