Created
July 25, 2020 22:11
-
-
Save mattdimicelli/78f175f357d8c0b5ce1b679f7e49389c to your computer and use it in GitHub Desktop.
help with order in dictionary output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def make_album(artist, album_name, songs = None): | |
''' Makes a dictionary describing a music album''' | |
if songs: | |
album = {artist, album_name, songs} | |
else: | |
album = {artist, album_name} | |
return album | |
album1 = make_album("Guns n' Roses", "The Spaghetti Incident") | |
print(album1) | |
album2 = make_album("Pink Floyd", "The Wall", "10") | |
print(f"\n{album2}") | |
album3 = make_album("Smash Brothers", "All Stars") | |
print(f"\n{album3}") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment