头歌给我的大猪题子,烦请各位解决

img

xushenglist = []
while True:
    txt = input("Please enter information separated by ','.\n input Q or q Exit the system:")
    if txt == 'q' or txt == "Q":
        break
    name, number, sex = txt.split(',')
    xushenglist.append({
        "name": name,
        "number": number,
        "sex": sex,
    })
name=input('Please enter your name')
for i in range(len(xushenglist)):
    if name==xushenglist[i]['name']:
        print(i)

有帮助请点击右上角采纳,有问题继续交流,你的采纳是对我回答的最大的肯定和动力

img