WHAT I DID TODAY:
Today I've completed the lesson/unit 'A Day at the Supermarket.' I mainly did exercises requiring 'loops' and 'lists and dictionaries.' Loops allow us to go through all the elements in a list, and use other codes/functions to further expand to different types of commands. I've now completed 45% of the overall course after finishing this lesson.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBsNlXtL_3nFmwI7W5dmzY8hWbckhbMKv00ZiijHdDQZ2KqLNes75CSeaeFZG26JThnCxVtwRAkN1cjsTEfDxBR9mknmo33TgnaaZBnxRUfgQ9BqQlr8ILc-BOH33cYB9ECoZXrB_KpbWR/s400/45%2525.PNG) |
45% COMPLETED |
And as always, I was told to do a review/exercise on what I learned.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibaP_pBYIBLVw19ktYDBI5Ve6yzPd7k0tDTARtax8mJ3arGORuH9aLW-ppJ59kB_vtP4rV3pArtMspXeiUND55DlekbbjmL9mjfEv11rR5gsziDlJ5wuTh60_Y8THGFWQXm3KIKYrL87bM/s640/supermarket+exercise.PNG) |
'AT THE SUPERMARKET EXERCISE' |
In this exercise I had to list the prices of fruit at the 'market' and how much of it is in stock. Then I had to use the new 'loop' code I learned to print out the whole list.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEih3w7DJBvjp7kEdC3hYC4T-8WFnm8FrU_WBsjienR8W4ZqUExxRuQl26kUpzFPnBRxyvhpErJLFKfo6rp_GTgZ_yq_I-i8DaU4jYJc5OqCmXc-Ulo495oBrQMmLn4fgpzVEajlYF2gFHCf/s640/knowing+how+much+ur+paying.PNG) |
CALCULATING COST |
I had to do another exercise, and this one was basically the last exercise and it required me to use codes to calculate the costs.
WHAT I LEARNED:
The main thing that was the focus of the lesson, was just loops. I learned that one new code, but learned a few different ways that code could be used and implemented together with other codes and functions.
I will quickly explain what a loop is again..
- I learned that the loop code uses for and in. You might have noticed the use of it in the photos above already. This command just goes through a list.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuSoG51q77GKTvVt1AAwGLFrZ3Sx5gRtshW1SGvhvtqseez8oHiQDeIIc-FnV1afGX_mtMA3D-wHrWy44-WvUODBd7rOieXtLWhEyXSyBlgGOGcrfJ37PU9KHnqUEU8-HoM1vDBlzBcfyr/s400/for+loop.PNG) |
LOOP EXERCISE |
And you can choose how to use the code. In this short exercise, all I had to do was print out the list.
- Another way I found out you could use loop for was to print only certain things you want from a list. For example, in an exercise that I will show below, I had to make sure the command only printed out 'even' numbers from a set of numbers.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiURsIznLwhlhFQh5b4ywWBjM5kErdhIPeV1rz-NIjO2_16LL1NMwA1WcRgyP-Kvx3vUnav6vSgy2RFsOUYaTNwmCMqHsPfJezZjYdmGBZsdrEwJfB_26s4KgNCjycjdmc6d03NuafEG9CZ/s640/performing+diferet+ations+with+loop.PNG) |
PRINTING OUT ONLY CERTAIN THINGS |
WHAT I WILL BE DOING TOMORROW / NEXT TIME:
Next time I will be continuing on with the course as usual. I will be moving onto the unit named 'Student Becomes Teacher.'
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFDYE9lvqtYo9qmoR7Rgm7y1kb1hML4hOgfQUP4awrvUuaQdVH4Z0E6sosIk0stnnevFSRf2wp52mzt3I-zNgIT81PaOdxhVRHrXgV_MNkyd348Da8-Q7BOkaFZupSvUBhqh9KADeBl8Or/s400/next+lessons.PNG) |
NEXT COURSE PREVIEW |
There are 9 lessons in total, and I am planning to go through all of it.