[Tutor] Coding for a Secret Message in a Game
Sky blaze
skyblaze101 at gmail.com
Sat Dec 14 21:48:00 CET 2013
Thank you for the answers! Unfortunately, I haven't had the time to test
them out, but these answers make a lot of sense, and I'm sure they'd work.
Again, thanks!
*See ya!*
-Skyblaze101
On Fri, Dec 13, 2013 at 2:20 PM, Danny Yoo <dyoo at hashcollision.org> wrote:
> Whoops, made a small typo in the program I sent. Let me rewrite again:
>
> ###############################################################
> def GetFailureMessage(failure_count):
> """Returns a message given how many times we've seen failure."""
> if failure_count <= 1:
> return "Try again"
> else:
> return "Please try again"
>
> ## Let's try it out:
> print(GetFailureMessage(0))
> print(GetFailureMessage(1))
> print(GetFailureMessage(2))
> ###############################################################
>
> (The mistake was in my "documentation string" at the beginning of the
> function. I put too few quotes at the end. Sorry about that!)
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20131214/d8eb70d1/attachment.html>
More information about the Tutor
mailing list