Skip to content

Instantly share code, notes, and snippets.

@magi196502
Forked from codecademydev/script.py
Created November 8, 2018 22:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save magi196502/73fefd9eb155c9476fd36f26fbcaad8b to your computer and use it in GitHub Desktop.
Save magi196502/73fefd9eb155c9476fd36f26fbcaad8b to your computer and use it in GitHub Desktop.
Codecademy export
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 price in prices:
total_price += price
average_price = total_price / len(prices)
print("Average Haircut Price:\n", average_price)
new_prices = [price - 5 for price 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 = [new_price for new_price in #new_prices if new_price < 30]
cuts_under_30 = [hairstyles[i]
for i in range(0,len(hairstyles)-1)
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