Answer the question
In order to leave comments, you need to log in
How to write a for loop to iterate over the sequences that are written in the body of the question?
I need to get something like this:
[{
«name»: «Tulip Serenade»,
«days»: 8,
«itinerary»: [amsterdam,amsterdam,arnhem …..],
«dates»:[
{«2019-04-04»:{«ship»: «ms amadeus queen», «price»:1044.65},
...(остальные даты)}
],
},..]
for a, b, c in zip(date, ship, price):
dates = [{a: {'ship': b, 'price': c}}]
data = [{'name': name,
'days': days,
'itinerary': itinerary,
'dates': dates
}]
[[{'name': 'Tulip Serenade', 'days': ' 8', 'itinerary': [' Amsterdam ', ' Amsterdam ', ' Arnhem ', ' Middelburg ', ' Ghent ', ' Antwerp ', ' Rotterdam ', ' Amsterdam '], 'dates': [{'26. Apr 2021 - 03. May 2021': {'ship': 'MS Amadeus Silver III', 'price': ' € 1.619,00 '}}]}]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question