> > Message: 6 > Date: Thu, 12 Dec 2013 23:10:31 -0500 > From: Sky blaze <skyblaze...@gmail.com> > To: tutor@python.org > Subject: [Tutor] Coding for a Secret Message in a Game >
> it'd be amusing to have the message change after the player types something > other than "start" at least 10 times. I've attempted numerous times to code > this, but all of them have failed. Could you help me with the coding? It > should look something like this in the end: > > while start != True: #Infinite loop that doesn't end until "start" is typed > if start_prompt == "start": > start = True #Continues from the title screen > else: > #This is where I'm stuck. I can loop it so it always returns the > command message when > #"start" isn't typed, but changing the message upon having that > occur at least 10 times is > #what's giving me trouble > Probably smarter people than I will have better ideas, but if you make your else an elif and use an expression something like *** counter = 0 # somewhere before the while elif counter < 10: counter += 1 print("type start") else print("just do it") that should (roughly) do it, unless I'm misunderstanding. Good luck!
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor