Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created September 12, 2020 16:48
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 codecademydev/a7a370b9d31521c97a76df0843a997d0 to your computer and use it in GitHub Desktop.
Save codecademydev/a7a370b9d31521c97a76df0843a997d0 to your computer and use it in GitHub Desktop.
Codecademy export
# Codecadmy Career Path - Data Science
# First Pyhon Project !
#----------------------------------------------------------------
# Create Purchasing Information and Receipts for Lovely Loveseats
# Adding In The Catalog------------------------------------------
# STEP 1: Adding our first item, the Lovely Loveseat that is the store’s namesake. Creating a variable called lovely_loveseat_description and assiging a string to it:
lovely_loveseat_description = """
Lovely Loveseat. Tufted polyester blend on wood. 32
inches high x 40 inches wide x 30 inches deep. Red or
white.
"""
# STEP 2: Creating a price for the loveseat. Creating a variable lovely_loveseat_price and setting it equal to 254.00
lovely_loveseat_price = 254.00
# STEP 3: Creating a variable called stylish_settee_description and assign to it a string
stylish_settee_descripttion = """
stylish Settee. Faux leather on birch. 29.50 inches
high x 54.75 inches wide x 28 inches deep. Black.
"""
# STEP 4: Creating a variable stylish_settee_price and assign it the value of 180.50.
stylish_settee_price = 180.50
# STEP 5: Create a new variable called luxurious_lamp_description and assign it
luxurious_lamp_description = """
Luxurious Lamp. Glass and iron. 36 inches tall. Brown
with cream shade.
"""
# STEP 6: Set the price for this item equal to 52.15
luxurious_lamp_price = 52.15
# STEP7: Set the sales tax equal to 0.088
sales_tax = 0.088
# The First Customer-------------------------------------------
# STEP 8: Defining a variable called customer_one_total. Since they haven’t purchased anything yet, let’s set that variable equal to 0
customer_one_total = 0
# STEP 9: Create a variable called customer_one_itemization and set that equal to the empty string "".
customer_one_itemization = ""
# STEP 10: Our customer has decided they are going to purchase our Lovely Loveseat! Add the price to customer_one_total.
customer_one_total += lovely_loveseat_price
# STEP 11: Add the description of the Lovely Loveseat to customer_one_itemization.
customer_one_itemization += lovely_loveseat_description
# STEP 12: Our customer has also decided to purchase the Luxurious Lamp! Let’s add the price to the customer’s total.
customer_one_total += luxurious_lamp_price
# STEP 13: Let’s keep the itemization up-to-date and add the description of the Luxurious Lamp to our itemization.
customer_one_itemization += luxurious_lamp_description
# STEP 14: Let’s begin by calculating sales tax. Create a variable called customer_one_tax and set it equal to customer_one_total times sales_tax.
customer_one_tax = customer_one_total * sales_tax
# STEP 15: Add the sales tax to the customer’s total cost.
customer_one_total += customer_one_tax
# STEP 16: Let’s start printing up their receipt! Begin by printing out the heading for their itemization. Print the phrase "Customer One Items:".
print("Customer One Items:")
# STEP 17: Print customer_one_itemization
print(customer_one_itemization)
# STEP 18: Now add a heading for their total cost: Print out "Customer One Total:"
print("Customer One Total:")
# STEP 19: Now print out their total! Our first customer now has a receipt for the things they purchased.
print(customer_one_total)
# STEP 20: Congratulations! We created our catalog and served our first customer. We used our knowledge of strings and numbers to create and update variables. We were able to print out an itemized list and a total cost for our customer. Lovely!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment