+ 1
Sentinel Not working, HELP!
I need to append a name and a score, and have it print both and keep collecting the information until sentinel is entered but the sentinel is not working. Names = [] Score = [] Index = 0 Max = 0 size = 0 def showList(): print(Names,Score) while Names != 0: n = input("Enter players name: (Enter XXX to end) ") Names.append(n) s = input("Enter score: ") Score.append(s) print(Names) print(Score) if Names == 0: break showList
7 Réponses
+ 1
A sentinel loop continues to process data until reaching a special value that signals the end. The special value is called the sentinel
+ 1
Yes
+ 1
but its not working
0
Thank you