Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Camsbury/1bafd1a56c4575f7720380f001b19f74 to your computer and use it in GitHub Desktop.
Save Camsbury/1bafd1a56c4575f7720380f001b19f74 to your computer and use it in GitHub Desktop.
Swamp 1.0
print ("Hello")
#Set the frogs variable
frogs = 2
print ("Here are {} frogs".format(frogs)
suggestion = "Let's breed them"
respect = ", don't watch it's rude"
initialization = (suggestion + respect)
def double_frogs(frogs):
"""Doubles your frogs!"""
print (initialization)
return frogs * 2
#Call with the frogs variable
frogs = double_frogs(frogs)
print("You now have {} frogs!".format(frogs))
#Updated to do what the messages say
print("Let's try a new food")
print("Pool sanitized")
frogs = 0
print("Here are 3 fresh frogs and the new food")
frogs += 3
def triple_frogs(frogs):
"""Triples your frogs"""
return frogs * 3
#reuse the frogs variable to actually triple your frogs
print("you now have " + str(triple_frogs(frogs)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment