Created
January 28, 2020 18:43
-
-
Save Cython-dot/db86dc11c3542052f2db04bf003ade2b to your computer and use it in GitHub Desktop.
Small Business in Python
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
""" | |
Carly's Clippers | |
You are the Data Analyst at Carly’s Clippers, the newest hair salon on the block. Your job is to go through the lists of data that have been collected in the past couple of weeks. You will be calculating some important metrics that Carly can use to plan out the operation of the business for the rest of the month. | |
You have been provided with three lists: | |
hairstyles: the names of the cuts offered at Carly’s Clippers | |
prices: the price of each hairstyle in the hairstyles list | |
last_week: the number of each hairstyle in hairstyles that was purchased last week | |
Let’s get started! | |
If you get stuck during this project or would like to see an experienced developer work through it, click “Get Help“ to see a project walkthrough video. | |
Carly's Clippers | |
You are the Data Analyst at Carly’s Clippers, the newest hair salon on the block. Your job is to go through the lists of data that have been collected in the past couple of weeks. You will be calculating some important metrics that Carly can use to plan out the operation of the business for the rest of the month. | |
You have been provided with three lists: | |
hairstyles: the names of the cuts offered at Carly’s Clippers | |
prices: the price of each hairstyle in the hairstyles list | |
last_week: the number of each hairstyle in hairstyles that was purchased last week | |
Let’s get started! | |
If you get stuck during this project or would like to see an experienced developer work through it, click “Get Help“ to see a project walkthrough video. | |
https://www.youtube.com/watch?v=ddMHCEs-wmE | |
""" | |
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 | |
#Can we do too total_price.append(price)? | |
average_price = total_price / len(prices) | |
print ("Average Haircut Price: " + str(average_price)) | |
new_prices = [price - 5 for price in prices] | |
print ("New prices:" + str(new_prices)) | |
total_revenue = 0 | |
for i in range(len(hairstyles)): | |
total_revenue+= prices[i] * last_week[i] | |
print ("Total revenue:" + str(total_revenue)) | |
average_daily_revenue = total_revenue / 7 | |
print("The average daily revenue:" + str(average_daily_revenue)) | |
cuts_under_30 = [hairstyles[i] for i in range(len(hairstyles)) 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
If you're having a hard time starting an IT company. As an example, it develops as a result of a search for quality. Then, in order to solve these problems, call devops advisory services their team of Ukrainian experts will assist you. You can run a prosperous IT company because of them. This business comes highly recommended by me.