Startertutorials Blog
Tutorials and articles related to programming, computer science, technology and others.
Subscribe to Startertutorials.com's YouTube channel for different tutorial and lecture videos.

Categories: Python Programming. 6 Comments on Introduction to Python Programming

This article provides an introduction to Python programming by describing what is Python, who is Python’s developer, Python applications and features, how to create and execute Python scripts, how to work with variables, what are different keywords and how to perform input/output in Python scripts.

 

What is Python?

Watch the below video which provides an introduction to Python programming in a detailed way. Otherwise, you can scroll down to read the same as text.

 

Watch this video for introduction to Python programming:

 

Python is a multi-paradigm, high-level, general purpose, scripting language.

 

Now, let’s understand about each of the terms in bold in the above Python definition.

 

Python supports multiple programming paradigms (models) like structured programming, object-oriented programming, and functional programming. So, it is called a multi-paradigm language.

 

Python is user friendly and can be used to develop application software like text editors, music players, etc. So, it is called a high-level language.

 

Python has several built-in libraries. There are also many third-party libraries. With the help of all these libraries we can develop almost anything with Python. So, it is called a general purpose language.

 

Finally, Python programs are executed line by line (interpreted) by an interpreter. So, it is called a scripting language.

 

Who Created Python?

 

Python was created by Guido Van Rossum. He worked at Google from 2005-2012. From 2013 onwards he is working at Dropbox.

 

guido-van-rossum-python

 

Guido Van Rossum was fond of a British comedian group named Monty Python. Their BBC series was Flying Circus. Rossum named the language after them (Monty Python).

 

History of Python

 

  • Python implementation began in 1989.
  • Python is a successor to ABC language (itself inspired by SETL).
  • First official release on 20 Feb 1991.
  • Python 2.0 was released on 16 Oct 2000.
  • Python 3.0 was released on 3 Dec 2008.
  • Latest stable release is Python 3.6.1 released in Mar. 2017.

 

Need for Python Programming

 

Following are some of the main reasons for learning Python language:

  • Software quality
  • Developer productivity
  • Program portability
  • Support libraries
  • Component integration

 

You can learn in detail about the above reasons in need to learn in Python programming article.

 

Applications of Python

 

  • Systems programming
  • GUIs
  • Internet scripting
  • Component integration
  • Database programming
  • Rapid prototyping
  • Numeric and scientific computing

 

To learn in detail about the above applications, go to applications of Python programming language.

 

Features of Python

 

For beginners it is important to known why do we have to choose Python as a programming language when there are so many other language out there. Some of the reasons why you need to choose Python are given below:

  • Object oriented and functional
  • Free
  • Portable
  • Powerful
  • Mixable
  • Easy to use
  • Easy to learn

 

To learn in detail about the above features, go to features of Python programming language.

 

Python Shell (REPL)

 

Python’s shell provides an interface for the users to interact with the Python interpreter. To learn more about entering into and using the Python shell, go to what is Python shell.

 

Running Python Scripts

 

A Python script is a file containing multiple lines of Python code saved with .py extension. A Python script can be directly executed line by line without any need to compile it. To learn more, go to creating and executing a Python script.

 

Variables

 

One of the essential concepts required to write programs in any language is a variable. A variable is used to store a value in memory. To learn more about variables in Python, click here.

Keywords

Keywords are reserved words which are predefined in Python. Each keyword has a pre-defined purpose and cannot be used as identifiers for variables, functions, etc. Learn more about Python keywords here.

 

Input and Output

 

For accepting input from keyboard, we use input function as follows:

 

input(“String to be displayed...”)

 

The input function returns back a string to the script. To work with numbers, we have to convert the returned string into number as follows:

 

x = int(input(“Enter a number: ”))

 

To print output to the standard output (terminal window), we use print as follows:

 

print(“Message to print...”)

 

Some examples of using print function:

 

print(“Welcome to Python”)
print(“Sum of ”, x, “ and ”, y, “is: ”, (x+y))
print(“hello”, end=‘ ’)
print(“world”)

 

Last two print statements will print “hello world” in a single line.

 

The print functions prints to standard output stream stdout which is available in sys module. Another way to print output is as follows:

 

import sys
sys.stdout.write(“Python Rocks!”)

 

Three standard streams are: stdin, stdout, and stderr.

 

Go back to Python programming tutorial homepage.

How useful was this post?

Click on a star to rate it!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Suryateja Pericherla

Suryateja Pericherla, at present is a Research Scholar (full-time Ph.D.) in the Dept. of Computer Science & Systems Engineering at Andhra University, Visakhapatnam. Previously worked as an Associate Professor in the Dept. of CSE at Vishnu Institute of Technology, India.

He has 11+ years of teaching experience and is an individual researcher whose research interests are Cloud Computing, Internet of Things, Computer Security, Network Security and Blockchain.

He is a member of professional societies like IEEE, ACM, CSI and ISCA. He published several research papers which are indexed by SCIE, WoS, Scopus, Springer and others.

6 Comments

You can follow any responses to this entry through the RSS 2.0 feed.

Python has deep support for more advanced software reuse mechanisms, such as object-oriented (OO) and function programming.

Can you explain this line??

    Yes. Python has in built support for creating classes and objects and also supports other object orientation concepts (which allows us to build reusable software components) like inheritance and polymorphism. Apart from these, Python programs are robust because of the exception handling mechanism. Similarly, Python also supports functional programming concepts.

sir, please provide us downloadable pdf file.
and thank you sir, your all pdf helps me lots.

sir, please provied downloadable pdf file for PYTHON

Leave a Reply

Your email address will not be published. Required fields are marked *