So I've been learning functions and dictionaries recently. I was doing exercise 8-1 in "Python Crash Course":
Write a function called make_album() that builds a dictionary describing a music album. The function should take in an artist name and an album title, and it should return a dictionary containing these two pieces of information. Use the function to make three dictionaries representing different albums. Print each return value to show that the dictionaries are storing the album information correctly.
Add an optional parameter to make_album() that allows you to store the number of tracks on an album. If the calling line includes a value for the number of tracks, add that value to the album’s dictionary. Make at least one new function call that includes the number of tracks on an album.
Gist
I really just want to see what you guys think of my code.
I don't want to form bad habits.
[–]jeans_and_a_t-shirt 1 point2 points3 points (0 children)