Python is simple to learn and, due to its wide range of applications, it is one of the most widely used programming languages today. Several studies have shown that as a Python beginner, you will be job-ready in less time than other programming language beginners.
- Learn about Python Match and Case statement (Switch statement) introduced in Python 3.10
Lets use sys.getsizeof() to check objects memory usage. It returns the size of object in bytes
import sys
my_list = [1,2,3,4,5,6,7,8,9,10]
print(sys.getsizeof(my_list)) #output in bytes
a = 10
print(sys.getsizeof(a)) #output in bytes
Output
136
28
Sometime naming a function is not a worth because of its one time use of use on map(),filter(),reduce() functions.
add=lambda x,y:x+y
add(1,2)
add(5,10)
Output
3
15
antigravity module is one of the easter eggs released by Python developers
when you import antigravity module, it opens up a web browser pointing to classic XKCD comic about python (https://xkcd.com/353/)
>>> import antigravity
Output
# Opens up a web browser pointing to https://xkcd.com/353/
Sometime you might want to use curly braces in your code rather than some whitespaces and indentation that python follows
Well, Probably you won't be able to do that in python
from __future__ import braces
Output
File "main.py", line 1
from __future__ import braces
SyntaxError: not a chance
Note: SyntaxError: Note: SyntaxError: