![screenshot-62](https://openlab.citytech.cuny.edu/mdiba-eportfolio/files/2012/08/Screenshot-62-300x169.png)
Today we were working on a project called ” a day to the supermarket” in code academy, using the python programming language. Now, i want to explain you how did i do the work successfully hoping that you will fully understand everything
![screenshot-63](https://openlab.citytech.cuny.edu/mdiba-eportfolio/files/2012/08/Screenshot-63-300x169.png)
here we are setting our program using for to just be familiar with it and understand how to use it before we start our program.
![screenshot-64](https://openlab.citytech.cuny.edu/mdiba-eportfolio/files/2012/08/Screenshot-64-300x169.png)
all of these stuffs is just like a preview to just show you how to use for loop because we going to apply them later in our program.
![screenshot-66](https://openlab.citytech.cuny.edu/mdiba-eportfolio/files/2012/08/Screenshot-66-300x169.png)
” a day to the super market” i am creating a variable (prices ) as a list name which has banana apple orange as key. each of the key have a value.
![screenshot-65](https://openlab.citytech.cuny.edu/mdiba-eportfolio/files/2012/08/Screenshot-65-300x169.png)
like any supermarket i am setting my stock. all of these value represent the amount number of the item in the stock.
![screenshot-67](https://openlab.citytech.cuny.edu/mdiba-eportfolio/files/2012/08/Screenshot-67-300x169.png)
like i said earlier we going to apply the for loop here to print out each item’s quantity in the stock and its price.
![screenshot-71](https://openlab.citytech.cuny.edu/mdiba-eportfolio/files/2012/08/Screenshot-71-300x169.png)
this is another section. after i am done with calculating the quantity and the price of my item, i am creating a new variable (groceries) which is a name of a new list.
![screenshot-73](https://openlab.citytech.cuny.edu/mdiba-eportfolio/files/2012/08/Screenshot-73-300x169.png)
we create a variable total after defining the function compute_bill, so we would know determine how much item will left once one is bought.