Wednesday, March 13, 2019

A DAY AT THE SUPERMARKET

A DAY AT THE SUPERMARKET

What this project is about...

for loops allow us to iterate through all of the elements in a list from the left-most (or zeroth element) to the right-most element.
This loop will run all of the code in the indented block under the for x in a: statement.
Example:
We can also add in the "if" element into this project...
And also the "return" element...
Then it slowly lead me into a exercise named "Your own store". It require me to set up a dictionary with entries and keys in it. Asked me to create a dictionary named "prices"
And then use the same step to create another dictionary named "stock". After that, print out all the inventory information, in this case would be printing the food name, price and the number of it in stock.

Then print the total, to calculate how much I will make by selling the food in stock.
Define a compute bill on to the system so that it calculates how much it takes you to get all the groceries you need. And it looks like this:

What I've learned...

  This project gave me a better understanding of how to use Python Languages in projects. And I now feel more confident about using what I've learned to finish projects.

No comments:

Post a Comment