File tree Expand file tree Collapse file tree
3. Mad Libs Generator/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22def story ():
33 template = "Didn't you hear? Supposedly %(noun)s %(verb)s is the new %(color)s."
44 dictionary = {}
5- dictionary ["noun" ] = raw_input ("Enter a noun: " )
6- dictionary ["verb" ] = raw_input ("Enter a -ing verb: " )
7- dictionary ["color" ] = raw_input ("Enter a color: " )
8- print template % dictionary
5+ dictionary ["noun" ] = input ("Enter a noun: " )
6+ dictionary ["verb" ] = input ("Enter a -ing verb: " )
7+ dictionary ["color" ] = input ("Enter a color: " )
8+ print ( template % dictionary )
99
1010def story2 ():
1111 template = "Every %(period_of_time)s I like to %(verb)s and %(verb2)s my %(emotion)s %(noun)s."
1212 dictionary = {}
13- dictionary ["period_of_time" ] = raw_input ("Enter a length of time: " ).lower ()
14- dictionary ["verb" ] = raw_input ("Enter a verb: " ).lower ()
15- dictionary ["verb2" ] = raw_input ("Enter another verb: " ).lower ()
16- dictionary ["emotion" ] = raw_input ("Enter an emotion: " ).lower ()
17- dictionary ["noun" ] = raw_input ("Enter a noun: " )
18- print template % dictionary
13+ dictionary ["period_of_time" ] = input ("Enter a length of time: " ).lower ()
14+ dictionary ["verb" ] = input ("Enter a verb: " ).lower ()
15+ dictionary ["verb2" ] = input ("Enter another verb: " ).lower ()
16+ dictionary ["emotion" ] = input ("Enter an emotion: " ).lower ()
17+ dictionary ["noun" ] = input ("Enter a noun: " )
18+ print ( template % dictionary )
1919
2020from random import choice
2121stories = [story , story2 ]
You can’t perform that action at this time.
0 commit comments