我无法通过用户输入展开我的扩展列表。我想我错过了如何使用if
语句来查询特定项目的列表。当用户输入-999时,我需要打开列表来询问输入。我还需要从列表中排除-999。你可以帮我吗?突破列表中的用户输入
print(scoreLst)
就是这样可以测试,看看它是如何工作,因为我使用它。
scoreLst =[]
score =()
lst1 = True
print("The list ends when user inputs -999")
scoreLst.append(input("Enter the test score: "))
while lst1 == True:
score1 = scoreLst.append(input("Enter another test score: "))
print(scoreLst)
if score1 != -999:
lst1 == True
else:
scoreLst.remove(-999)
lst1 == False
追加验证之前没有进入榜单 – vks