What The Heck Is Python? Executive Summary!

Reading Time: 2 minutes

Python is an easy to learn, powerful programming language and object-oriented programming language created by Guido van Rossum. It wasn’t named after a dangerous snake 😛 . Rossum was the fan of a comedy series from the late seventies. The name “Python” was adopted from the same series “Monty Python’s Flying Circus”.

Python

Everything in Python is an object. Sites like Mozilla, Reddit and Instagram are written in Python.

3 Reasons why to Choose Python as First Language

  • Simple Elegant Syntax – It is easier to understand and write python code.



This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters


number1 = 5
number2 = 6
multiply = number1 * number2
print(multiply)
view raw

mul.py

hosted with ❤ by GitHub

  • Not overly strict – Neither there is a need to define type in python nor it is necessary to add a semicolon at the end. But Python enforces you to follow proper indentation as a good practice
  • Expressiveness of the language – Python allows you to write programs having greater functionality with fewer lines of code.

How to Install Python on Ubuntu

  • To make sure that our versions are up-to-date, let’s update and upgrade the system with apt-get:

$ sudo apt-get update
$ sudo apt-get -y upgrade

  • By default, Python comes preinstalled in Ubuntu. But if you want to update Python you can follow the following instructions.
  • Go to the official site of Python and click on Download Python 3.6.1.
  • Now, go to the directory where the file is downloaded and run the command to extract the .tar Python:

$ tar -xvf Python-3.6.1.tar.xz

  • Go to the extracted Directory of Python:

$ cd Python-3.6.1

  • Issue the following commands to compile Python source code on your Operating system.

$ ./configure
$ make
$ sudo make altinstall

  • As a newbie we recommend you to install sublime text in ubuntu and the commands are:

$ sudo add-apt-repository -y ppa:webupd8team/sublime-text-2
$ sudo apt-get update
$ sudo apt-get install sublime-text

  • Open Sublime text. To create a new file, go to File > New File (Shortcut: Ctrl+N).
  • Save the file with .py file extension as primeNumber.py.
  • Write the code and save it (Ctrl+S or File > Save). For starters, you can copy the code below:



This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters


def prime(number):
for a in range(2, number+1):
if number % a & number != a:
return true
else:
return false
view raw

primeNumber.py

hosted with ❤ by GitHub
  • Go to Tool > Build (Shortcut: Ctrl+B). You will see the output at the bottom of Sublime Text. Congratulations, you’ve successfully run your first Python program.

You can refer to my Python repository for some basic understanding of how to code in python: Python Programming for beginners

Happy Coding!! 🙂

KNOLDUS-advt-sticker

Written by 

Charmy is a Software Consultant having experience of more than 1.5 years. She is familiar with Object Oriented Programming Paradigms and has familiarity with Technical languages such as Scala, Lagom, Java, Apache Solr, Apache Spark, Apache Kafka, Apigee. She is always eager to learn new concepts in order to expand her horizon. Her hobbies include playing guitar and Sketching.

5 thoughts on “What The Heck Is Python? Executive Summary!2 min read

  1. The intent to introduce to Python is good, but… Why Sublime Text? It’s not free and it costs. PyCharm is much better, and for free. And in case you just want a text editor, there are Geany, Kate, VIM and Emacs, all of them completely free.

  2. please don’t do “sudo make install” as this will overwrite your system’s python and potentially making your system unusable. If you really have to compile your own python version rather than using the one already installed in Ubuntu, at lease use “make altinstall”

Comments are closed.

Discover more from Knoldus Blogs

Subscribe now to keep reading and get access to the full archive.

Continue reading