The following cell creates three lists
makers
,revenues
, andcountries
of the same length. Create two new list of tuples such that:
- Each tuple takes the elements at the same index position from the three lists
- The last element in the tuple is preceded by the string 'Made in '.
For example, the first and last tuples in the new list are
('Toyota', 265, 'Made in Japan')
and('Ford', 156, 'Made in US')
respectively. Do not make any change tomakers
,revenues
, andcountries
.makers = ["Toyota", "Volkswagen", "Hyundai", "Daimler", "GM", "Honda", "Ford"] revenues = [265, 260, 97, 185, 157, 138, 156] countries = ["Japan", "Germany", "Korea", "UK", "US", "Japan", "US"]
My Code:
autos1 = [(makers, revenues, countries) for makers, revenues, countries in zip(makers, revenues, countries)]
Result:
[('Toyota', 265, 'Japan'),
('Volkswagen', 260, 'Germany'),
('Hyundai', 97, 'Korea'),
('Daimler', 185, 'UK'),
('GM', 157, 'US'),
('Honda', 138, 'Japan'),
('Ford', 156, 'US')]
Need help with adding the "Made In"