Map practice

 Tonight I started learning about the map function in python, and quickly didn't understand what my course was trying to explain. Before I got too far ahead of myself, I decided to have my bestie ChatGPT run me through a practice of how it works. 

At first when I started, the course had a really confusing way of saying what map did, but a youtube video had a great one line description of it. What map does is takes a function and a list, and applies that function to everything in the given list. 


my practice tonight (after I did a few assignments on my normal course, dont worry I didn't just do two lines of code for the last two hours) ended up being this.




really short and sweet, but thats the idea of coding, right? try to have your code be as simple and functional as possible.  It starts by running each item in the list through .lower to make everything lowercase. then it capitalizes the first letter in each item of the list, then prints the list at the end. 

nice and simple practice tonight. I might end up doing a little more practice with map tomorrow, and have ChatGPT give me something a little bit harder and more real world.

Comments

Popular Posts