Skip to content

Instantly share code, notes, and snippets.

@horstjens
Created July 29, 2014 06:22
Show Gist options
  • Save horstjens/c18377ebb36d7f8a564f to your computer and use it in GitHub Desktop.
Save horstjens/c18377ebb36d7f8a564f to your computer and use it in GitHub Desktop.
story printer
# 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