Tuesday, August 7, 2018

What is Python Programming Language? | The First Python Code! | Codeing School

Introduction


Python is an energizing and intense dialect with the correct mix of execution and highlights that stamp programming fun and simple. It is an abnormal state, deciphered, intelligent, question situated, and solid dialect that is exceptionally basic and utilizations English like words. It has a huge library of modules to help the reconciliation of complex arrangements from pre-fabricated segments.

What is Python Programming Language? | The First Python Code! | Codeing School
What is Python Programming Language?

    Python is an open source venture, upheld by numerous people. It is a stage autonomous, scripted dialect, with finish access to working framework APIs. This enables clients to incorporate applications flawlessly to make powerful, very engaged applications. Python is a total programming dialect with the accompanying highlights. 

History

Python is a genuinely old dialect made by Guido Van Rossum. The plan started in the late 1980s and was first discharged in February 1991. 

Why Python was made? 

In the late 1980s, Guido Van Rossum was chipping away at the Amoeba dispersed working framework gathering. He needed to utilize a deciphered dialect like (ABC has basic straightforward punctuation) that could get to the Amoeba framework calls. In this way, he chose to make a dialect that was extensible. This prompted outline of another dialect which was later named Python. 

Why the name Python? 

No. It wasn't named after a risky snake. Rossum was the enthusiast of a parody arrangement from the late seventies. The name "Python" was embraced from a similar arrangement "Monty Python's Flying Circus".

Features of Python 

  • A simple language which is easier to learn
  • Free and open-source
  • Extensible and Embeddable
  • A high-level interpreted language
  • Large standard libraries
  • Object-oriented

Applications on Python

  • Web Applications
  • Scientific and Numeric Computing
  • Creating software Prototypes

Installing and Run Python on Windows


  • Go to Download Python page on the official site and click Download Python 3.7.0 (You may see different version name).
  • When the download is completed, double-click the file and follow the instructions to install it.
  • When Python is installed, a program called IDLE is also installed along with it. It provides the graphical user interface to work with Python.
  • Open IDLE, copy the following code below and press enter.
  • print("Hello, World!")
  • To create a file in IDLE, go to File > New Window (Shortcut: Ctrl+N).
  • Write Python code (you can copy the code below for now) and save (Shortcut: Ctrl+S) with .py file extensions like hello.py or your-first-program.py
  • print("Hello, World!")
  • Go to the Run > Run module (Shortcut: F5) and you can see the output. Congratulations, you've successfully run your first Python program.

Who to Write My First Program in Python?

A program called "Hello, World!" is used to introduce a new programming language for beginners.  "Hello, World!" is a simple program that outputs "Hello, World!".

        However, Python is one of the easiest languages to learn, and creating "Hello, World!" program is as simple as writing print("Hello, World!"). So, we are going to write a different program.

Add Tow Number in Python

Add Tow Number in Python

Add Tow Number in Python

How Python Program is Run?

Line 1: # Add two numbers

Any line starting with # in Python programming is a comment.

Comments are used in programming to describe the purpose of the code. This helps you as well as other programmers to understand the intent of the code. Comments are completely ignored by compilers and interpreters.

Line 2: a = 2

Here, a is a variable. You can store a value in a variable. Here, 2 is stored in this variable.

Line 3: b = 3

Similarly, 3 is stored in b variable.

Line 4: sum = a+b

The variables a and b are added using + operator. The result of addition is then stored in another variable sum.

Line 5: print(sum)

The print() function prints the output to the screen. In our case, it prints 5 on the screen.

Output

Few Important Things to Remember

To represent a statement in Python, newline (enter) is used. The use of semicolon at the end of the statement is optional (unlike languages like C/C++, JavaScript, PHP). In fact, it's recommended to omit semicolon at the end of the statement in Python.

Instead of curly braces { }, indentations are used to represent a block.

   im_a_parent:
    im_a_child:
        im_a_grand_child
    im_another_child:
        im_another_grand_child



0 comments:

Post a Comment