Member-only story
10 lesser-known facts about python
3 min readOct 6, 2021
- Python is the only language to have an else condition for a “for loop”. It executes if the for loops terminates normally without any “break”.
The else will be fired if there’s no even number on the list.
2. You can assign () to [], but not the other way round.
The reason is [] is an empty list and () is an empty tuple. Tuples are immutable meaning you can’t change them once created.
3. Python uses indentation to mark blocks whereas other languages use braces. If you run “from __future__ import braces”, you’ll get -
it’s a joke, meaning even in the future, Python won’t use braces.
4. You can assign different values to different variables at the same time.