Created
July 29, 2014 06:22
-
-
Save horstjens/c18377ebb36d7f8a564f to your computer and use it in GitHub Desktop.
story printer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pyhton3 example to teach python coding to young students | |
import random | |
friends = ["Anne","Bettina","Clara","Daniela"] | |
verbs = ["kissing","beating", "taunting","scaring","cooking","cleaning","eating","feeding"] | |
things = ["frog","airplane","castle","wizard","spaceship","elephant"] | |
adjectives = ["growing","impatient","hungry","angry","happy","sad", "unruly","nervous"] | |
for girl in friends: | |
verb = random.choice(verbs) | |
thing = random.choice(things) # object is a reserved python keyword | |
adj = random.choice(adjectives) | |
print(girl,"is",verb,"the",adj,thing+".") # comma makes a space, + not | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment