Python learning resources
Beginner to advanced Python guides, cheatsheets, books and projects.
For data science, backend and automation.
Join π https://rebrand.ly/bigdatachannels
DMCA: @disclosure_bds
Contact: @mldatascientist
Post #1187
569
π Top 5 Unique Facts About Python
Python looks simpleβ¦
but internally itβs full of surprising behavior π
1οΈβ£ Variables Are Just References π
Python variables donβt store values.
They point to objects in memory.
Output: [1, 2, 3]
π Both changed because they point to the SAME object.
2οΈβ£ Everything in Python is an Object π¦
Even integers, functions, and classes.
Output: <class 'int'>
π Numbers, strings, functionsβ¦ all are objects.
3οΈβ£ Functions Are First-Class Citizens β‘
Functions can be passed, returned, and stored.
Output: Hello
π Functions behave like normal variables.
4οΈβ£ Small Integers Are Cached π§
Python reuses small integers.
Output: True
π Same object reused internally.
5οΈβ£ Indentation Defines Structure π
No curly braces needed.
π Indentation = code structure
π Clean but error-prone
Python looks simpleβ¦
but internally itβs full of surprising behavior π
1οΈβ£ Variables Are Just References π
Python variables donβt store values.
They point to objects in memory.
a = [1, 2]
b = a
b.append(3)
print(a)
Output: [1, 2, 3]
π Both changed because they point to the SAME object.
2οΈβ£ Everything in Python is an Object π¦
Even integers, functions, and classes.
x = 10
print(type(x))
Output: <class 'int'>
π Numbers, strings, functionsβ¦ all are objects.
3οΈβ£ Functions Are First-Class Citizens β‘
Functions can be passed, returned, and stored.
def greet():
return "Hello"
func = greet
print(func())
Output: Hello
π Functions behave like normal variables.
4οΈβ£ Small Integers Are Cached π§
Python reuses small integers.
a = 256
b = 256
print(a is b)
Output: True
π Same object reused internally.
5οΈβ£ Indentation Defines Structure π
No curly braces needed.
if True:
print("Hello")
π Indentation = code structure
π Clean but error-prone
- β€ 5






