Super Market

super-market

First we make the list withe the following names. Once this is done we then make a for loop with the variable x. Once that was been done we call the variable which consists of the list so it repeats the list

super-market-2

when we have a word containing a definitions we must call the definitions using the brackets. So before calling the bracket we must call the variable but include the brackets and inside those brackets must contain the variable in order to call the definition inside.

super-market-3

So now the list we have contains a set of numbers from the 0 to 12, in order to call the list while being squared we use the same for loop but include “**2” which the squares all the numbers inside at the list. Finally we must call the variable.

super-market-4

a simple count function

super-market-5

code academy demonstrating the usage of a list.

super-market-6

So the example we use is that we own a fruit shop. the fruit we have must have a price so we assign each fruit with a price using the list function.

super-market-7

Of course we cannot have unlimited amounts of fruits. so we must have a stock of them. Sadly we have no bananas, however we have plenty of oranges

super-market-8

Okay now let’s play the customer, so if we were to be the customer the price would be determined by the fruit price+ the fruit stock. So price plus the quantity will determine the price.

super-market-10

our last situation we use is groceries. Our groceries are banana, apple, and orange

super-market-11

So with the past list we have created, whatever we buy is price of each product+ price of each product.

super-market-12

For those customers that want an item that is no longer available we must also include that and subtract it if it was included.

super-market-13

Finally we return

The main purpose of the assignment is to go more in debt of the use of the list. The list’s purpose is to sort out information in a specific way depending what’s in the list. List’s not only hold information but can also be used to mix with other information to your choosing. The usage of a list is good practice for the assortment of information overall.