Hi All,
I am Alex from the UK (30), currently run an ecommerce company but used to be an analyst for Amazon and now wanting to refresh and learn some new skills. My SQL is ok but Python is new - I have just done the Frida Kahlo project and think all is ok here.
My question would be, when creating new lists, such as zipping the paintings list, how can I do this on one line of code rather than having to reiterate the paintings list?
paintings = [‘The Two Fridas’, ‘My Dress Hangs Here’, ‘Tree of Hope’, ‘Self Portrait With Monkeys’]
dates = [1939, 1933, 1946, 1940]
paintings = zip(paintings, dates)
paintings = list(paintings)
paintings.extend(([‘The Broken Column’, 1944],[‘The Wounded Deer’, 1946,],[‘Me and My Doll’, 1937]))
#paintings.append([‘The Broken Column’, 1944])
#paintings.append([‘The Wounded Deer’, 1946,])
#paintings.append([‘Me and My Doll’, 1937])
audio_tour_number =
#for i in range(len(paintings)):
print(i)
for i in range(1, len(paintings) + 1):
audio_tour_number.extend(str(i))
print(“Audio tour numbers:”, audio_tour_number)
master_list = zip(audio_tour_number, paintings)
master_list = list(master_list)
print(master_list)