-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmad-lib-generator.py
More file actions
36 lines (23 loc) · 882 Bytes
/
Copy pathmad-lib-generator.py
File metadata and controls
36 lines (23 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Mad Libs Generator
# https://knightlab.northwestern.edu/2014/06/05/five-mini-programming-projects-for-the-python-beginner/
story = """The %s %s was running on the %s and found a %s %s and picked it up.
After smelling the %s, they %s and went %s."""
words = []
print("Let's start a Mad Lib! Give me an adjective: ")
words.append(input())
print("A singular noun: ")
words.append(input())
print("A singular noun: ")
words.append(input())
print("An adjective: ")
words.append(input())
print("A singular noun: ")
words.append(input())
print("A singular noun: ")
words.append(input())
print("A intransitive verb (takes zero objects): ")
words.append(input())
print("A participle (an -ing word): ")
words.append(input())
# String format with lists: https://stackoverflow.com/questions/7568627/using-python-string-formatting-with-lists
print(story % tuple(words))