-
Notifications
You must be signed in to change notification settings - Fork 10
/
12. review.py
31 lines (19 loc) · 1.08 KB
/
12. review.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
highlighted_poems = "Afterimages:Audre Lorde:1997, The Shadow:William Carlos Williams:1915, Ecstasy:Gabriela Mistral:1925, Georgia Dusk:Jean Toomer:1923, Parting Before Daybreak:An Qi:2014, The Untold Want:Walt Whitman:1871, Mr. Grumpledump's Song:Shel Silverstein:2004, Angel Sound Mexico City:Carmen Boullosa:2013, In Love:Kamala Suraiyya:1965, Dream Variations:Langston Hughes:1994, Dreamwood:Adrienne Rich:1987"
print(highlighted_poems)
highlighted_poems_list = highlighted_poems.split(',')
print(highlighted_poems_list)
highlighted_poems_stripped = []
for poem in highlighted_poems_list:
highlighted_poems_stripped.append(poem.strip())
print(highlighted_poems_stripped)
highlighted_poems_details = []
for i in highlighted_poems_stripped:
highlighted_poems_details.append(i.split(':'))
print(highlighted_poems_details)
titles, poets, dates = [], [], []
for i in highlighted_poems_details:
titles.append(i[0])
poets.append(i[1])
dates.append(i[2])
for titles, poets, dates in zip(titles, poets, dates):
print("The poem {} was published by {} in {}.".format(titles, poets, dates))