Hello, this is technically day 6. But I'll call it day 2 to keep up with the publishing dates and everything. So keep that in mind incase you read my previous post and get confused a little bit, haha. Again, I will be re-doing the whole python and even though I have some knowledge about it, I'll still re-learn it because why not? (this is to also keep up with the Kaggle learning path)
Okay, let's go:
So first we start with a simple syntax;
Hello Python Syntax, Variable Assignment and Numbers.
Numbers;
The arithmetic we learned in primary school has conventions about the order in which operations are evaluated. Some remember these by a mnemonic such as PEMDAS - Parentheses, Exponents, Multiplication/Division, Addition/Subtraction. Python basically follows the same rule on which calculations to perform first. This is the 'order of operations.' Python's two main numerical types, int and float can also be called as functions which convert their arguments to the corresponding type.
I did a simple exercise on the notebook to test everything out, although they give you a simple written 1 or 2 lines of code but you would have to fill out the rest to get your answer/output.
Can't lie they aren't as easy if you are beginner and some did challenge me little bit, haha. But they're good to keep you active. Check them out.
Bonus;
Adding code to the following cell to swap variables a and b (so that a refers to the object previously referred to by b and vice versa).
a = [1, 2, 3]
b = [3, 2, 1]
q2.store_original_ids()
The most straightforward solution is to use a third variable to temporarily store one of the old values. Using the following trick to swap two variables in one line, here;
tmp = a
a = b
b = tmp
Yeah, that does it. This is some of the learning I did. I didn't write some but highlighted the most important parts and the ones that I really liked.
Another one follows tomorrow, hope to see you then. Bye.
Top comments (0)