问题:创建一个名为 team.txt 的文本文件并存储 8 个足球队的名称和他们的最佳球员,用逗号分隔球员和球队名称。创建一个程序,该程序从文本文件中读取并显示一个随机的团队名称以及玩家名字的第一个字母和他们的姓氏的第一个字母。
import random
teamList = open("team.txt", "__")
data = teamList._______()
randomChoice= random._______(____)
teamName =[]
player =[]
for lines in data:
split = lines._____(',')
teamName.______(split[0])
player._______(_____[1])
teamName = teamName[_______]
letters = _______[randomChoice]
print("\nThe team is ",______)
splitLetters = letters._____(' ')
print("And the first letter of the player’s firstname and surname is")
for x in range(_____(splitLetters)):
print((______[x][_]).upper())