Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
1,367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.39 KB | None | 0 0
  1. #Codecademy Project 1 = CREATE PURCHASING INFORMATION AND RECEIPTS FOR LOVELY LOVESEATS
  2.  
  3. #PART 1 - ADDING IN THE CATALOG
  4.  
  5. #Step 1 - Create variable called lovely_loveseat_description and add the string as the values
  6. lovely_loveseat_description = """
  7. Lovely Loveseat. Tufted polyester blend on wood. 32 inches
  8. high x 40 inches wide x 30 inches deep. Red or white.
  9. """
  10.  
  11. #Step 2 - Create a price for the loveseat. Create a variable lovely_loveseat_description and set it equal to 254.00
  12. lovely_loveseat_price = 254.00;
  13.  
  14. #Step 3 - Create a variable called stylish_settee_description and assign it to the string provided
  15. stylish_settee_description = """
  16. Stylish Settee. Faux leather on birch. 29.50 inches high x
  17. 54.75 inches wide x 28 inches deep. Black.
  18. """
  19.  
  20. #Step 4 - Create a variable stylish_settee_price and assign it the value of 180.50
  21. stylish_settee_price = 180.50;
  22.  
  23. #Step 5 - Create a new variable called luxurious_lamp_description and assign it the provided string
  24. luxurious_lamp_description = """
  25. Luxurious Lamp. Glass and iron. 36 inches tall. Brown with
  26. cream shade.
  27. """
  28.  
  29. #Step 6 - Create a variable called luxurious_lamp_price and set it equal to 52.15
  30. luxurious_lamp_price = 52.15;
  31.  
  32. #Step 7 - Define the variable: sales_tax and set it equal to .088. That's 8.8%
  33. sales_tax = .088;
  34.  
  35. #PART 2 - OUR FIRST CUSTOMER
  36.  
  37. #Step 8 - Our first customer is making their purchase! Let's keep a running tally of their expenses by defining a variable called customer_one_total. Since they haven't purchased anything yet, let's set that variable equal to 0 for now.
  38. customer_one_total = 0;
  39.  
  40. #Step 9 - We should also keep a list of the descriptions of things they're purchasing. Create a variable called customer_one_itemization and set that equal to the empty string "". We'll tack on the descriptions to this as they make their purchases
  41. customer_one_itemization = "";
  42.  
  43. #Step 10 - Our customer has decided they are going to purchase our Lovely Loveseat! Add the price to customer_one_total.
  44. customer_one_total += lovely_loveseat_price;
  45.  
  46. #Step 11 - Let's start keeping track of the items our customer purchased. Add the description of the Lovely Loveseat to customer_one_itemization
  47. customer_one_itemization += lovely_loveseat_description;
  48.  
  49. #Step 12 - Our customer has also decided to purchase the Luxurious Lamp! Let's add the price to the customer's total
  50. customer_one_total += luxurious_lamp_price;
  51.  
  52. #Step 13 - Let's keep the itemization up-to-date and add the description of the Luxurious Lamp to our itemization
  53. customer_one_itemization += luxurious_lamp_description;
  54.  
  55. #Step 14 - They’re ready to check out! 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
  56. customer_one_tax = (customer_one_total * sales_tax);
  57.  
  58. #Step 15 - Add the sales tax to the customer's total cost
  59. customer_one_total += customer_one_tax;
  60.  
  61. #Step 16 - Let's start printing up their receipt! Begin by printing out the heading for their itemization. Print the phrase "Customer One Items:"
  62. print("Customer One Items:")
  63.  
  64. #Step 17 - Print customer_one_itemization
  65. print(customer_one_itemization);
  66.  
  67. #Step 18 - Now add a heading for their total cost: Print out "Customer One Total:"
  68. print("Customer One Total:");
  69.  
  70. #Step 19 - Now print out their total! Our first customer now has a receipt for the things they purchased.
  71. print(customer_one_total)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement