amount_of_names = int(input("Input amount of players: "))
names = []
for counter in range(amount_of_names):
name = str(input("Input players first name: "))
names.append(name)
#print (names)
selected_name = str(input("Input your name: "))
while name in names:
import random
names = random.choice(names)
break
print (names)
我试图用名称与“你的名字”进行匹配,然后循环,直到名称不匹配例如Bob:Sam(是)Sam:Sam(No) - 在此先感谢所有循环直到(py)
“循环期间清除”是什么意思? –