artist_best_song = {
"Green Day": "Boulevard of Broken Dreams",
"Cosmo Sheldrake": "Come Along",
"Rebecca Sugar": "Love Like You",
"Sia": "Chandelier",
"Mitski": "Nobody",
"NF": "The Search",
"Hozier": "Take Me to Church",
"Dawid Podsiadlo": "Little Stranger",
"Macklemore": "Glorious",
"Sol Seppy": "Enter One"
}
for artist, song in artist_best_song.items():
print(song + " song is the best song of " + artist)
Run to view results
artist_best_song = {
"Green Day": "Boulevard of Broken Dreams",
"Cosmo Sheldrake": "Come Along",
"Rebecca Sugar": "Love Like You",
"Sia": "Chandelier",
"Mitski": "Nobody",
"NF": "The Search",
"Hozier": "Take Me to Church",
"Dawid Podsiadlo": "Little Stranger",
"Macklemore": "Glorious",
"Sol Seppy": "Enter One"
}
favorite_song_artist = {
"Boulevard of Broken Dreams": "Green Day",
"Come Along": "Cosmo Sheldrake",
"Love Like You": "Rebecca Sugar",
"Chandelier": "Sia",
"Nobody": "Mitski",
"The Search": "NF",
"Take Me to Church": "Hozier",
"Little Stranger": "Dawid Podsiadlo",
"Glorious": "Macklemore",
"Enter One": "Sol Seppy"
}
gender_artist = {
"Green Day": "his",
"Cosmo Sheldrake": "his",
"Rebecca Sugar": "her",
"Sia": "her",
"Mitski": "her",
"NF": "his",
"Hozier": "his",
"Dawid Podsiadlo": "his",
"Macklemore": "his",
"Sol Seppy": "her"
}
for artist, best_song in artist_best_song.items():
if best_song in favorite_song_artist and favorite_song_artist[best_song] == artist:
print(best_song + " is my favorite song of artist " + artist + ", and it is also his/her best song")
else:
print(best_song + " is the best song of artist " + artist + ", but it is not one of my favorite songs")
Run to view results
top_bands = {'The Beatles':{'John':["vocals", "guitars", "keyboards", 'harmonica', "bass",
"(1960–1969; died 1980)"],
'Paul':["vocals", 'bass', 'guitars', 'keyboards', 'drums', "(1960–1970)"],
'George':["guitars", 'vocals', 'sitar', 'keyboards', 'bass',
"(1960–1970; died 2001)"],
'Ringo':["drums", 'percussion', 'vocals', "(1962–1970)"]
},
'The Rolling Stones':{'Mick':["lead and backing vocals", 'harmonica', 'rhythm guitar',
'percussion', 'keyboards', 'bass guitar', "(1962–present)"],
'Keith':['rhythm and lead guitars', 'bass guitar', 'keyboards',
'percussion', 'backing and lead vocals', '(1962–present)'],
'Ronnie':['lead and rhythm guitars', 'bass guitar', 'backing vocals',
'(1975–present)']
}
}
for band, members in top_bands.items():
for member, info in members.items():
print(member + " belongs to " + band)
print(member + " plays " + ", ".join(info[:-1]))
print(member + " belonged to the band during " + info[-1])
if "died" in info[-1]:
print(member + " is not alive")
else:
print(member + " is alive")
Run to view results
n = 0
for i in range(0, 200):
if i % 2 == 0 and i**2 < 200:
n = i
print(n)
Run to view results