-
-
Save codecademydev/abf27f24eabe0839cb43b85fbb8dd8a0 to your computer and use it in GitHub Desktop.
Codecademy export
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hairstyles = ["bouffant", "pixie", "dreadlocks", "crew", "bowl", "bob", "mohawk", "flattop"] | |
prices = [30, 25, 40, 20, 20, 35, 50, 35] | |
last_week = [2, 3, 5, 8, 4, 4, 6, 2] | |
total_price = 0 | |
for i in prices: | |
total_price += i | |
average_price = total_price/len(prices) | |
print(average_price) | |
new_prices = [(p - 5) for p in prices] | |
print(new_prices) | |
total_revenue = 0 | |
for i in range(len(hairstyles)): | |
total_revenue += prices[i] * last_week[i] | |
print('Total Revenue:',total_revenue) | |
average_daily_revenue = total_revenue / 7 | |
print(average_daily_revenue) | |
cuts_under_30 = [hairstyles[i] for i in range(len(new_prices)) if new_prices[i] < 30] | |
print(cuts_under_30) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment