What The Heck Is Python??


Python_logo_and_wordmark.svg.png

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.

  • 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:

  • 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

Advertisements
This entry was posted in Scala and tagged , , , , , . Bookmark the permalink.

4 Responses to What The Heck Is Python??

  1. Gourry Gabrief says:

    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. irmendejong says:

    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”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s