You're the best pilot we ever had, part II
You're the best pilot we ever had, part II
I am learning Python like there's no tomorrow and hopefully I can soon reveal why.
I'm in the office learning it day in day out - that's right I still have access to my office space. Because it was an annexe office we have a contract that still lasts a bit longer. And so I'm learning Python in here. Every day. Like there's no tomorrow. I'm learning Python like there's no tomorrow.
I love electricity. The lights don't turn on for me.
I turn on for the lights.
Python
I've been working on lists and there is a LOT to learn. The one that is messing with my head is len().
It goes like this:
len(mylist)
len(someotherlist)
Tuples
They are like lists but they are immutable. You can't change them. So you could do something like this:
susanna = ("Susanna", 29, "Renewable Energy Software Engineer")
You can also do some destructuring assignment:
name, age, occupation = susanna
print(name)
# Output: Susanna
and so on...
.zip()
AMONGST OTHER USES, zip can allow us to combine two arrays into a 2D array.
I learned about this today, it was cool. You have to convert things back into a list though and the inner items on the list become tuples.
I'm onto for loops again now...
... I loved the joke about super duper nested loops in JS. Why stop at i or j when you can have iij or ijs...
I did a lot of loops in Python. I found list comprehensions really tough. They are new to me.
It's all okay. I will learn them. I will get them.
Functions
I am starting functions in Python now.
Why did I ever end up in my office writing functions in Python at 8 pm on a Saturday night? Who even am I anymore? Why and what even is the purpose of my existence?
Still image from Moby's "Everloving" music video. Because why on earth not? |
The syntax is so similar and the parameters are so similar too - I spent long enough breaking that down in JavaScript in January last year - I don't need to spend too long on this.
Comments
Post a Comment