Skip to content

Commit 9f12f43

Browse files
authored
mad-libs.py
simple user input
1 parent 7e2d96b commit 9f12f43

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

mad-libs.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
""" Mad Libs Generator
2+
----------------------------------------
3+
SOURCE: https://hackr.io/blog/python-projects?utm_source=programming_emails&utm_campaign=topic_follow_email&utm_medium=email&utm_content=blog_link
4+
5+
"""
6+
#Loop back to this point once code finishes
7+
loop = 1
8+
while (loop < 2):
9+
# All the questions that the program asks the user
10+
noun = input("Choose a noun: ")
11+
p_noun = input("Choose a plural noun: ")
12+
noun2 = input("Choose a noun: ")
13+
place = input("Name a place: ")
14+
adjective = input("Choose an adjective (Describing word): ")
15+
noun3 = input("Choose a noun: ")
16+
# Displays the story based on the users input
17+
print ("------------------------------------------")
18+
print ("Be kind to your",noun,"- footed", p_noun)
19+
print ("For a duck may be somebody's", noun2,",")
20+
print ("Be kind to your",p_noun,"in",place)
21+
print ("Where the weather is always",adjective,".")
22+
print ()
23+
print ("You may think that this is the",noun3,",")
24+
print ("Well it is.")
25+
print ("------------------------------------------")
26+
# Loop back to "loop = 1"
27+
loop = loop + 1

0 commit comments

Comments
 (0)