10 lesser-known facts about python

Photo by Dan Dennis on Unsplash
  1. 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”.
for loop with else
list and tuple assignment
indentation for braces
variable assignment
value swap
a, b = b, a
return multiple values
String reversal
Transpose of a matrix
string multiplication
with block


Hope this article was helpful. Follow me for more cool and informative articles on python.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store