Python interesting facts

1. Python is on Mars

2. Python is older than Java

3. Python has multiple flavors

  1. CPython: This is the standard Python which is written in C language
  2. Jython: Here Python code is compiled using Java Byte code and executed using jvm
  3. IronPython: It is written in C# language
  4. PyPy: Python written using Python itself
  5. MicroPython: Python run on microcontrollers

4. We can define infinite value in Python

postive_infinity = float(‘inf’)negative_infinity = float(‘-inf’)

5. Python can return multiple values

def func():
return 1, 2
a = func()print(a)
(1, 2)

6. Python influences JavaScript

numbers = [1, 2, 3, 4, 5]reversed = numbers[::-1]
[5, 4, 3, 2, 1]

8. Python is named after a television show

9. String Literal concatenation

a = “Hello “ “World”
‘Hello World’

10. Else block for loops

for i in range(5):
print(“0 to 4 printed”)
0 to 4 printed
for i in range(5):
if i == 2:
print(“0 to 4 printed”)

11. Import this

import this
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren’t special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one — and preferably only one — obvious way to do it.
Although that way may not be obvious at first unless you’re Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it’s a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea — let’s do more of those!



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