-
Notifications
You must be signed in to change notification settings - Fork 0
/
1.madlibs.py
36 lines (24 loc) · 1002 Bytes
/
1.madlibs.py
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
35
36
# # string concatenation (aka how to put string together)
# youtuber = input("")
# # ways to concatenate
# print("subscribe to " + youtuber)
# print("subscribe to {}".format(youtuber))
# print(f"subscribe to {youtuber}")
adj = input("Adjective: ")
verb1 = input("Verb1: ")
verb2 = input("Verb2: ")
famous_person = input("Famous person: ")
# METHOD 1
madlib = f"Computer Programming is so {adj}! It makes me so excited \
all the time because I love to {verb1}. Stay hydrated and {verb2} \
like you are {famous_person}"
print(madlib)
# # METHOD 2
madlib = "Computer Programming is so " + adj + "! "+ "It makes me so excited all the time \
because I love to " + verb1 + ". " + "Stay hydrated and "+ verb2 + "like \
you are "+ famous_person
print(madlib)
# METHOD 3
madlib = "Computer Programming is so {}! It makes me so excited all the \
time because I love to {}. Stay hydrated and {} like you are {}".format(adj,verb1,verb2,famous_person)
print(madlib)