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.”
The code in the next image prints out all the definitions of the words in “Webster.”
In the following image, the code seen only prints out the even numbers in the list called “a.”
In this screenshot, it is displayed that a “count” will print only if the item in x is the equals “fizz”.
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.
Dictionary called “prices” was created in the image below to show the prices of items in a supermarket.
Another dictionary called “stock” was created to represent a supermarket’s stock.
The following code displays a list of the price and stock of each item in the supermarket.
The image below displays a code used to display the total cost of all your inventory.
The following code will print out the bill of the total of all items in the shopping list.
Changes were made to “compute_bill” in the following code to exclude items that aren’t in stock.
This is an image of the code fully completely and it is fully functional.