So I'm new to Python, and was trying to generate the following dictionary comprehensions from the two lists.
top5shows = ['Soldier','The Run', 'Metachomas','The Average Lad','James Eathersen']
budget = [200, 110, 34, 2, 0.5]
revenue = [220,190, 80, 2.3, 1]
profit_dict = {show: (((rev - bud) / bud) * 100) for show in top5shows for rev in revenue for bud in budget}`
The idea is to produce a dictionary with the name of the movie as the key, and it's percentage of profit as the value. However, the result is giving me the same value for all the keys, which is the profit percentage of the last movie in the list.
Result:
{'Soldier': 100.0, 'The Run': 100.0, 'Metachomas': 100.0, 'The Average Lad': 100.0, 'James Eathersen': 100.0}