Frida Kahlo Cumulative Project Code Review

I didn’t work on this with Jupyter because I don’t have access to the program on the computer I worked on. If anyone wants to review mine, I’d greatly appreciate it. I’ll return the favor to someone else (or the reviewer).

First, create a list called paintings and add the following titles to it:‘The Two Fridas’, ‘My Dress Hangs Here’, ‘Tree of Hope’, ‘Self Portrait With Monkeys’

paintings=[“The Two Fridas”, “My Dress Hangs Here”, “Tree of Hope”, “Self Portrait With Monkeys”]

dates=[1939, 1933, 1946, 1940]

Combine the lists w/ Zip

paintings=list(zip(paintings, dates))

print(paintings)

4. Append the following paintings

paintings.append((“The Broken Column”, 1944))

paintings.append((“The Wounded Deer”, 1946))

paintings.append((“Me and My Doll”, 1937))

print(paintings)

5 Since each of these paintings is going to be in the audio tour, they each need a unique identification number. But before we assign them a number, we first need to check how many paintings there are in total. Find the length of the paintings list.

len(paintings)

print(“There are " + str(len(paintings)) + " paintings.”)

#Use the range method to generate a list of identification numbers that starts at 1 and is equal in length to our list of items. Save the list to the variable audio_tour_number and check your work by printing the list.

audio_tour_number = list(range(7))

print(audio_tour_number)

#We’re finally ready to create our master list. Zip the audio_tour_number list to the paintings list and save it as master_list.

master_list = zip(paintings, audio_tour_number)

#8. Print the master_list to the terminal.

print(master_list)

Cheers!

Going forward, please post formatted code.

See: :arrow_down:

That said, moving on…

This part isn’t correct (we’d see that if we could view the output printed out as well here):

audio_tour_number = list(range(7))
#which results in:
[0, 1, 2, 3, 4, 5, 6]

#there are 7 paintings, so, range isn't used correctly.

See:

range() has three arguments, start, stop, step (step is optional). If the start argument is absent, then it defaults to 0 (key point here).

So, your last step won’t be correct b/c range() is off:

master_list = list(zip(audio_tour_number, paintings))
print(master_list)

#almost right
[(0, ('The Two Fridas', 1939)), (1, ('My Dress Hangs Here', 1933)), (2, ('Tree of Hope', 1946)), (3, ('Self Portrait With Monkeys', 1940)), (4, ('The Broken Column', 1944)), (5, ('The Wounded Deer', 1946)), (6, ('Me and My Doll', 1937))]


Also, you don’t necessarily need Jupyter to do this project. Just use Google Colab (turn off the AI suggestions in it). It’s based on Jupyter, but cloud-based (it’s just an app you add to your Drive). There’s documentation on how to use its features as well.

1 Like