Assignment#8: A Day at the Supermarket

The lesson on codeacademy called “A day at the Supermarket” helps build an understanding of how list and functions can be used together.

The following image shows code that is used to print out the items of the list “names.”

market1

The code in the next image prints out all the definitions of the words in “Webster.”

market2

In the following image, the code seen only prints out the even numbers in the list called “a.”

market3

In this screenshot, it is displayed that a “count” will print only if the item in x is the equals “fizz”.

market4

When the code is ran in the image below, it prints outs the letters in “codeacademy” one at a time and each “i” in the variable “word” is printed out.

market5

Dictionary called “prices” was created in the image below to show the prices of items in a supermarket.

market6

Another dictionary called “stock” was created to represent a supermarket’s stock.

market7

The following code displays a list of the price and stock of each item in the supermarket.

market8

The image below displays a code used to display the total cost of all your inventory.

market9

The following code will print out the bill of the total of all items in the shopping list.

market11

Changes were made to “compute_bill” in the following code to exclude items that aren’t in stock.

market12

This is an image of the code fully completely and it is fully functional.

market13