Saturday 26 October 2019

Python - Day Twelve (October)

WHAT I DID TODAY:




Today I completed the 'Python Lists and Dictionaries' Unit. There were 14 lessons in total, and I was able to go through it all. Now I have finished 40% of the course.



40% COMPLETE

They also made me do a review as usual. It may look a bit foreign and confusing, but I will explain what's new and what I learned in the 'What I learned' section of my post.


THE FINAL REVIEW

I will give a brief explanation of what I was told to do in this review. I didn't write all of that, instead I just wrote the code starting from line 13 where it says # Your code here.

Basically I had to 'remove' and 'add' items that are in my inventory. That's what the review was mainly about.


WHAT I LEARNED:



I learned quite a few new things, that relates to lists and 'edit' them.


  • If you don't like the commas in a list, there's another way to make a list of items. And that is the .append() code. It's hard to explain but basically, below there's an example of suitcase and items. After doing suitcase.append(item) you could add any item in. Below is a visual representation. 


ANOTHER WAY TO ADD ITEMS/STUFF



  • Another code I learned for the 'lists' is the .remove() This one was pretty self explanatory, it just removes things from the list that you don't want anymore. In the photo below, you will see that the items that are removed does not appear on the list.
REMOVE CODE



WHAT I WILL BE DOING TOMORROW / NEXT TIME:


Next time I will moving onto the unit 'A Day at the Supermarket' There are 13 lessons total, and I will be aiming to complete it all.

PREVIEW OF NEXT UNIT

No comments:

Post a Comment

Adobe Photoshop - Day 10 (June Final Post)

WHAT I DID TODAY / WHAT I LEARNED: For my final project, I thought for a while about what I could do. Then I remembered a while back I saw ...