{"id":24829598,"url":"https://github.com/sarahm44/lens-slice","last_synced_at":"2025-03-26T02:11:33.762Z","repository":{"id":274784142,"uuid":"924054559","full_name":"sarahm44/lens-slice","owner":"sarahm44","description":"Uses Python lists to organise sales data for a pizza store.","archived":false,"fork":false,"pushed_at":"2025-01-29T11:07:27.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T11:34:08.526Z","etag":null,"topics":["codecademy","codecademy-courses","codecademy-cs","codecademy-pro","python-lists","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sarahm44.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-29T10:35:00.000Z","updated_at":"2025-01-29T11:17:30.000Z","dependencies_parsed_at":"2025-01-29T11:44:27.450Z","dependency_job_id":null,"html_url":"https://github.com/sarahm44/lens-slice","commit_stats":null,"previous_names":["sarahm44/lens-slice"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarahm44%2Flens-slice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarahm44%2Flens-slice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarahm44%2Flens-slice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarahm44%2Flens-slice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sarahm44","download_url":"https://codeload.github.com/sarahm44/lens-slice/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245573904,"owners_count":20637674,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codecademy","codecademy-courses","codecademy-cs","codecademy-pro","python-lists","python3"],"created_at":"2025-01-30T23:26:36.207Z","updated_at":"2025-03-26T02:11:33.743Z","avatar_url":"https://github.com/sarahm44.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Codecademy Project: Len's Slice\n\n![\"\"](https://github.com/sarahm44/lens-slice/blob/main/pizza.jpg)\n\n## Overview\nFor this project, I imagine I work at Len’s Slice, a new pizza joint in the neighborhood. I use my knowledge of Python lists to organize some of my sales data.\n\nThe Python notebook containing the code is [here](https://github.com/sarahm44/lens-slice/blob/main/lens_slices.py).\n\n## Tasks\n### Make Some Pizzas\n1. To keep track of the kinds of pizzas you sell, create a list called \u003ccode\u003etoppings\u003c/code\u003e that holds the following:\n\n* \u003ccode\u003e\"pepperoni\"\u003c/code\u003e\n* \u003ccode\u003e\"pineapple\"\u003c/code\u003e\n* \u003ccode\u003e\"cheese\"\u003c/code\u003e\n* \u003ccode\u003e\"sausage\"\u003c/code\u003e\n* \u003ccode\u003e\"olives\"\u003c/code\u003e\n* \u003ccode\u003e\"anchovies\"\u003c/code\u003e\n* \u003ccode\u003e\"mushrooms\"\u003c/code\u003e\n\n![\"\"](https://github.com/sarahm44/lens-slice/blob/main/task_01.png)\n\n2. To keep track of how much each kind of pizza slice costs, create a list called \u003ccode\u003eprices\u003c/code\u003e that holds the following integer values:\n\n* \u003ccode\u003e2\u003c/code\u003e\n* \u003ccode\u003e6\u003c/code\u003e\n* \u003ccode\u003e1\u003c/code\u003e\n* \u003ccode\u003e3\u003c/code\u003e\n* \u003ccode\u003e2\u003c/code\u003e\n* \u003ccode\u003e7\u003c/code\u003e\n* \u003ccode\u003e2\u003c/code\u003e\n\n![\"\"](https://github.com/sarahm44/lens-slice/blob/main/task_02.png)\n\n3. Your boss wants you to do some research on $2 slices. Count the number of occurrences of \u003ccode\u003e2\u003c/code\u003e in the \u003ccode\u003eprices\u003c/code\u003e list, and store the result in a variable called \u003ccode\u003enum_two_dollar_slices\u003c/code\u003e. Print it out.\n\n![\"\"](https://github.com/sarahm44/lens-slice/blob/main/task_03.png)\n\nThe code output is as follows:\n\n![\"\"](https://github.com/sarahm44/lens-slice/blob/main/output_03.png)\n\n\n4. Find the length of the toppings list and store it in a variable called \u003ccode\u003enum_pizzas\u003c/code\u003e.\n\n![\"\"](https://github.com/sarahm44/lens-slice/blob/main/task_04.png)\n\n5. Print the string \u003ccode\u003eWe sell [num_pizzas] different kinds of pizza!\u003c/code\u003e, where \u003ccode\u003e[num_pizzas]\u003c/code\u003e represents the value of our variable \u003ccode\u003enum_pizzas\u003c/code\u003e.\n\n![\"\"](https://github.com/sarahm44/lens-slice/blob/main/task_05.png)\n\nThe code output is as follows:\n\n![\"\"](https://github.com/sarahm44/lens-slice/blob/main/output_05.png)\n\n6. Use the existing data about the pizza toppings and prices to create a new two-dimensional list called \u003ccode\u003epizza_and_prices\u003c/code\u003e.\n\nEach sublist in \u003ccode\u003epizza_and_prices\u003c/code\u003e should have one pizza topping and an associated price.\n\n| Price |\tTopping |\n|----|----|\n| \u003ccode\u003e2\u003c/code\u003e | \u003ccode\u003e\"pepperoni\"\u003c/code\u003e |\n| \u003ccode\u003e6\u003c/code\u003e | \u003ccode\u003e\"pineapple\"\u003c/code\u003e |\n| \u003ccode\u003e1\u003c/code\u003e | \u003ccode\u003e\"cheese\"\u003c/code\u003e |\n| \u003ccode\u003e3\u003c/code\u003e | \u003ccode\u003e\"sausage\"\u003c/code\u003e |\n| \u003ccode\u003e2\u003c/code\u003e | \u003ccode\u003e\"olives\"\u003c/code\u003e |\n| \u003ccode\u003e7\u003c/code\u003e | \u003ccode\u003e\"anchovies\"\u003c/code\u003e |\n| \u003ccode\u003e2\u003c/code\u003e | \u003ccode\u003e\"mushrooms\"\u003c/code\u003e |\n\nFor this new list make sure the prices come before the topping name like so:\n\n\u003ccode\u003e[price, topping_name]\u003c/code\u003e\n\n\u003cb\u003eNote:\u003c/b\u003e You don’t need to use your original \u003ccode\u003etoppings\u003c/code\u003e and \u003ccode\u003eprices\u003c/code\u003e lists in this exercise. Create a new two-dimensional list from scratch.\n\n![\"\"](https://github.com/sarahm44/lens-slice/blob/main/task_06.png)\n\n7. Print \u003ccode\u003epizza_and_prices\u003c/code\u003e.\n\n![\"\"](https://github.com/sarahm44/lens-slice/blob/main/task_07.png)\n\nThe code output is as follows:\n\n![\"\"](https://github.com/sarahm44/lens-slice/blob/main/output_07.png)\n\n### Sorting and Slicing Pizzas\n8. Sort \u003ccode\u003epizza_and_prices\u003c/code\u003e so that the pizzas are in the order of increasing price (ascending).\n\n![\"\"](https://github.com/sarahm44/lens-slice/blob/main/task_08.png)\n\nThe code output is as follows:\n\n![\"\"](https://github.com/sarahm44/lens-slice/blob/main/output_08.png)\n\n\n9. Store the first element of \u003ccode\u003epizza_and_prices\u003c/code\u003e in a variable called  \u003ccode\u003echeapest_pizza\u003c/code\u003e.\n\n![\"\"](https://github.com/sarahm44/lens-slice/blob/main/task_09.png)\n\nThe code output is as follows:\n\n![\"\"](https://github.com/sarahm44/lens-slice/blob/main/output_09.png)\n\n\n10. A man walks into the pizza store and shouts “I will have your MOST EXPENSIVE pizza!”\n\nGet the last item of the  \u003ccode\u003epizza_and_prices\u003c/code\u003e list and store it in a variable called  \u003ccode\u003epriciest_pizza\u003c/code\u003e.\n\n![\"\"](https://github.com/sarahm44/lens-slice/blob/main/task_10.png)\n\nThe code output is as follows:\n\n![\"\"](https://github.com/sarahm44/lens-slice/blob/main/output_10.png)\n\n\n11. It looks like the most expensive pizza from the previous step was our very last  \u003ccode\u003e\"anchovies\"\u003c/code\u003e slice. Remove it from our  \u003ccode\u003epizza_and_prices\u003c/code\u003e list since the man bought the last slice.\n\n![\"\"](https://github.com/sarahm44/lens-slice/blob/main/task_11.png)\n\n12. Since there is no longer an  \u003ccode\u003e\"anchovies\"\u003c/code\u003e pizza, you want to add a new topping called \u003ccode\u003e\"peppers\"\u003c/code\u003e to keep your customers excited about new toppings. Here is what your new topping looks like:\n\n \u003ccode\u003e[2.5, \"peppers\"]\u003c/code\u003e\n\nAdd the new peppers pizza topping to our list  \u003ccode\u003epizza_and_prices\u003c/code\u003e.\n\n\u003cb\u003eNote:\u003c/b\u003e Make sure to position it relative to the rest of the sorted data in  \u003ccode\u003epizza_and_prices\u003c/code\u003e, otherwise our data will not be correctly sorted anymore!\n\n![\"\"](https://github.com/sarahm44/lens-slice/blob/main/task_12.png)\n\n13. Three mice walk into the store. They don’t have much money (they’re mice), but they do each want different pizzas.\n\nSlice the  \u003ccode\u003epizza_and_prices\u003c/code\u003e list and store the 3 lowest cost pizzas in a list called  \u003ccode\u003ethree_cheapest\u003c/code\u003e.\n\n![\"\"](https://github.com/sarahm44/lens-slice/blob/main/task_13.png)\n\n14. Great job! The mice are very pleased and will be leaving you a 5-star review.\n\nPrint the  \u003ccode\u003ethree_cheapest\u003c/code\u003e list.\n\n![\"\"](https://github.com/sarahm44/lens-slice/blob/main/task_14.png)\n\nThe code output is as follows:\n\n![\"\"](https://github.com/sarahm44/lens-slice/blob/main/output_14.png)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarahm44%2Flens-slice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsarahm44%2Flens-slice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarahm44%2Flens-slice/lists"}