Close
Close

Python Tutorial - Introduction


Python is a widely used high-level dynamic programming language. It is a very simple, friendly and easy to learn programming language. It is the best choice for a beginner programmer. Python source code is also available under GNU General Public License (GPL).

Who use Python?


As mentioned above, it is a widely used programming language. Some of the places where Python is used are :

  • Google - Python is one of the key language used in google.
  • Philips - Philips uses Python for the sequencing language (language that tells what steps each robot should take).
  • Frequentis - Frequentis is the originator of TAPTools, a software product that is used for air traffic control in many airports. This particular tool provides updates on the weather and runway conditions to air traffic controllers. So, you depend on Python when you fly.
  • Quora - Quora also chose Python for its development.
  • CodesDope - Yes, we also use Python.
  • Battlefield 2 - Battlefield 2 uses Python to implement core elements of its gameplay such as score-keeping and team-balancing.
  • Instagram - Instagram also uses Python for its backend.
  • Walt Disney Feature Animation - Walt Disney Feature Animation is also using Python to make their animation production system more efficient in scripting.
  • NASA - Johnson Space center uses Python in its Integrated Planning System as the standard scripting language.
  • Civilization 4 - The new addition to the legendary strategy game series has all of its inner logic, including AI, implemented in Python.
  • YouTube - We all love youtube and and youtube loves using Python
  • DropBox - Dropbox allows us to store, sync, and share almost anything using the power of Python.
  • Pinterest - Pinterest is a visual discovery tool that allows users to showcase their interests through the posting of pictures.

This list is never-ending, with new additions to it every day, but I hope it is enough to motivate you to learn Python.

How is Python simple?


I will write a code to print "Hello World" on the screen in C, Java and Python. Decide yourself which is simpler.

C

#include <stdio.h>
main()
{
    printf("Hello World");
}

Java

class hello
{
    public static void main(String []args)
    {
         System.out.println("Hello World");
    }
}

Python

print("Hello World")

How to run Python


Running Python In Windows


1. Download Python3.

download python for windows

2. Install it.

3. Open IDLE (PythonGUI).

python shell in windows

To run directly on shell


4. Type the code given below and press Enter and then you can see Hello World printed on the screen.

print("Hello World")
run python codes in python shell in windows

To run from a file


4. Go to File -> New File

saving python codes in windows

5. Type the Python code given below and save it.

print("Hello World")

6. Go to Run -> Run Module and you will see Hello World printed.

run python codes from file in windows
run python codes from file in windows

Now, you know how to write and run Python codes and you are ready to go for the next chapter

Running Python In Linux


1. Open terminal ( ctrl+alt+T ).

terminal in Ubuntu

To run from a file


2. Open a new file with .py extension ( name of our file is hello.py ) in your favourite text editor (we are using gedit).

gedit hello.py

open file with .py in gedit

3. Write the Python code given below and save it.

print("Hello World")

4. To run this code, enter python3 hello.py (it means that you have to enter 'python3 filename').

run python code in terminal

Now, you can see Hello World printed on the screen.

So, now you know to write and run Python codes from file.

To run on Python shell


2. Enter python3 command in the terminal, then it will activate the python shell

open python shell in terminal

3. Enter the code given below and you will see Hello World printed.

print("Hello World")
run codes in python shell in terminal

Now, you are ready to go for the next chapter.

Running Python In Mac


1. Open terminal.

terminal in Mac

To run from a file


2. Open a new file with .py extension ( name of our file is hello.py ) in your favourite text editor (we are using VS Code).

code hello.py

We have used the command code to open the file hello.py in VS Code. You can use a command corresponding to your editor or can directly make a file.

open file with .py in VS Code

3. Write the Python code given below and save it.

print("Hello World")

4. To run this code, enter python3 hello.py (it means that you have to enter 'python3 filename').

run python code in terminal

Now, you can see Hello World printed on the screen.

If is pre-installed in Mac. If it is not in your computer, you can follow this guide to install it.

So, now you know to write and run Python codes from file.

To run on Python shell


2. Enter python3 command in the terminal, then it will activate the python shell

open python shell in terminal

If is pre-installed in Mac. If it is not in your computer, you can follow this guide to install it.

3. Enter the code given below and you will see Hello World printed.

print("Hello World")
run codes in python shell in terminal

Now, you are ready to go for the next chapter.

To learn from simple videos, you can always look at our Python video course on CodesDope Pro. It has over 500 practice questions and over 20 projects.
Sometimes you gotta run before you can walk.
- Iron Man


Ask Yours
Post Yours
Doubt? Ask question