我想创建一个程序,从列表中选择一个团队并显示球员姓名和位置。
像这样的东西:
Enter the team: A
Enter the position number: 1
然后它应该打印如下内容:
At postion 1 is John
这是我到目前为止得到的:
def display_team(TeamNum, Team):
print "Team" + TeamNum + ": "
for player in Team:
print player
#main
#Lists used to define the teams
TeamA = ["John", "Peter", "Philip", "Ben"]
TeamB = ["Bill", "Tommy", "Pete", "Manny"]
display_team('A', 'TeamA')
display_team('B', 'TeamB')
team = raw_input("Enter the team: ")
position = int(raw_input("Enter the position:"))
raw_input("\nPress enter to continue")