Today's files from your teacher
This commit is contained in:
parent
1732455c89
commit
c82f4e8a4b
6 changed files with 182 additions and 0 deletions
34
madlibs_fox.py
Normal file
34
madlibs_fox.py
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# MAD LIBS — Fox
|
||||
#
|
||||
# The story is at the bottom. It is already written.
|
||||
# The story needs words. Each word goes in a box (a variable).
|
||||
#
|
||||
# 3 boxes are done for you. 2 are not.
|
||||
# Find the ____ lines and finish them. Copy the ones that are done.
|
||||
# If you see NameError: name '____' you missed a blank.
|
||||
#
|
||||
# Run it with the play button ▶ (top right).
|
||||
|
||||
|
||||
name = input("Type a name: ")
|
||||
animal = input("Type an animal: ")
|
||||
food = input("Type a food: ")
|
||||
|
||||
place = ____ # Ask for a place. Copy a line above and change it.
|
||||
silly_word = ____ # Ask for a silly word.
|
||||
|
||||
|
||||
# ----- THE STORY -----
|
||||
# The f means: fill in the boxes.
|
||||
# {animal} means: open the box called animal and put its word here.
|
||||
|
||||
print()
|
||||
print(f"One day, {name} found a giant {animal} in the {place}.")
|
||||
print(f"The {animal} was eating {food}.")
|
||||
print(f"It looked up and yelled, \"{silly_word}!\"")
|
||||
print(f"So {name} shared the {food}, and they became best friends.")
|
||||
print("THE END")
|
||||
|
||||
|
||||
# BONUS 1: Add one more line to the story. Use one of your boxes in it.
|
||||
# BONUS 2: Make a new box called color. Use it in the story.
|
||||
Loading…
Add table
Add a link
Reference in a new issue