How do you make a new list based on the product in python?
Anonymous User
121

Dumb question:

I have two lists:

lst_city = ['NY', 'SF', 'SEA']
dist = [5, 2, 3]

I want to make a new list by multiplying:

new_lst = ['NY', 'NY', 'NY', 'NY', 'NY', 'SF', 'SF', 'SEA', 'SEA', 'SEA']

How can I do that in python efficiently?

Thanks!

Comments (3)