1 num = 10 2 count = 3 3 girl = [] 4 girl1 = [] 5 while num>0: 6 first = input("请输入你的心动女生:(还有{0}次机会!!:)".format(num)) 7 num -=1 8 9 girl.append(first) 10 print("你的心动女生有:") 11 for i in girl: 12 print("编号:{0},名字:{1}".format(girl.index(i)+1,i)) 13 14 while count>0: 15 count -= 1 16 second = int(input("再次确认第%s心动女生的编号(%s次机会):"%((3-count),count+1))) 17 18 girl1.append(second) 19 20 for j in girl1: 21 print("你更喜欢的女生有.编号:%s,名字:%s"%(j,girl[j-1])) 22 23 third = int(input("最后确认心动女生的编号:")) 24 print("你最喜欢的女生有.编号:%s,名字:%s"%(third,girl[j-1]))