Saurav Jain (Open Source + Communities) Profile picture
Developer Community Manager @Apify โ€ข ex ๐Ÿฅ‘@amplication โ€ขOpen Sourceโ€ข Web Scraping/Automation โ€ข AI โ€ข Python โ€ข JavaScript โ€ขGitHub โ€ข Node.js

Jul 2, 2021, 7 tweets

Five Easter Eggs in Python ๐Ÿ

๐Ÿงต๐Ÿ‘‡

1โƒฃ ๐—ฏ๐—ฟ๐—ฎ๐—ฐ๐—ฒ๐˜€

One of the most amazing feature of python is to NOT using braces rather it uses "indentation".

If you try to import braces from future in python then you will get a funny response :P

๐Ÿ“ Here is the code and output

2โƒฃ ๐—ญ๐—ฒ๐—ป ๐—ผ๐—ณ ๐—ฃ๐˜†๐˜๐—ต๐—ผ๐—ป

It is a guide to Python design principles( total = 19 )

Written by Tim Peters - American Software Developer

It is the only official easter egg stated as an easter egg in python developer guide.

๐Ÿ“ Here is the code and output

3โƒฃ ๐—ฎ๐—ป๐˜๐—ถ๐—ด๐—ฟ๐—ฎ๐˜ƒ๐—ถ๐˜๐˜†

If you are coding whole day and got tired.

This module is for you to have some laugh :)

It redirects you to the site - xkcd.com/353/

๐Ÿ“ Here is the code and output

4โƒฃ ๐—›๐—ฒ๐—น๐—น๐—ผ ๐—ช๐—ผ๐—ฟ๐—น๐—ฑ !

Most of us have our first program goal to print "Hello World!" .

You know what ?

Python have a secret module to print this :)

๐Ÿ“ Here is the code and output

5โƒฃ ๐—ฅ๐—ฒ๐˜ƒ๐—ฒ๐—ฟ๐˜€๐—ฒ ๐—ฎ ๐—น๐—ถ๐˜€๐˜

While in other languages you have to write a N number lines of code to reverse a list.

Python as always is amazing and do it in just a single line of code.

๐Ÿ“ Here is the code and output

I hope you like this thread and got something new to learn about Python ๐Ÿ

I daily post threads about Python and Machine Learning

RT the first tweet in this thread if you like this :)

Share this Scrolly Tale with your friends.

A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.

Keep scrolling