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”.
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|
- 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.
$ 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:
- 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!! 🙂