Python Indtroduction

  1. free simple site templates Python is a general purpose, dynamic, high level and interpreted programming language. It supports Object Oriented programming approach to develop applications. It is simple and easy to learn and provides lots of high-level data structures.
  2. Python is easy to learn yet powerful and versatile scripting language which makes it attractive for Application Development. Python's syntax and dynamic typing with its interpreted nature, makes it an ideal language for scripting and rapid application development.
  3. Python supports multiple programming pattern, including object oriented, imperative and functional or procedural programming styles.
  4. Python is not intended to work on special area such as web programming. That is why it is known as multipurpose because it can be used with web, enterprise, 3D CAD etc.
  5. We don't need to use data types to declare variable because it is dynamically typed so we can write a=10 to assign an integer value in an integer variable.
  6. Python makes the development and debugging fast because there is no compilation step included in python development and edit-test-debug cycle is very fast.

Python 2 vs. Python 3

In most of the programming languages, whenever a new version releases, it supports the features and syntax of the existing version of the language, therefore, it is easier for the projects to switch in the newer version. However, in the case of Python, the two versions Python 2 and Python 3 are very much different from each other.

A list of differences between Python 2 and Python 3 are given below:
  1. In Python 2 uses print as a statement and used as print "something" to print some string on the console. On the other hand, Python 3 uses print as a function and used as print("something") to print something on the console.
  2. Python 2 uses the function raw_input() to accept the user's input. It returns the string representing the value, which is typed by the user. To convert it into the integer, we need to use the int() function in Python. On the other hand, Python 3 uses input() function which automatically interpreted the type of input entered by the user. However, we can cast this value to any type by using primitive functions (int(), str(), etc.).
  3. In Python 2, the implicit string type is ASCII, whereas, in Python 3, the implicit string type is Unicode
  4. Python 3 doesn't contain the xrange() function of Python 2. The xrange() is the variant of range() function which returns a xrange object that works similar to Java iterator. The range() returns a list for example the function range(0,3) contains 0, 1, 2.
  5. There is also a small change made in Exception handling in Python 3. It defines a keyword as which is necessary to be used. We will discuss it in Exception handling section of Python programming

Our Online Python Compiler

You do not need to install Python on your computer to follow this tutorial. However, we recommend you to run Python programs in Online Python Compiler section.

Python Features

  • free bootstrap theme Python provides lots of features that are listed below.
  • Easy to Learn and Use - Python is easy to learn and use. It is developer-friendly and high level programming language.
  • Expressive Language - Python language is more expressive means that it is more understandable and readable.
  • UNIQUE STYLES - Python is an interpreted language i.e. interpreter executes the code line by line at a time. This makes debugging easy and thus suitable for beginners.
  • Cross-platform Language - Python can run equally on different platforms such as Windows, Linux, Unix and Macintosh etc. So, we can say that Python is a portable language.
  • Free and Open Source - Python language is freely available at offical web address (https://www.python.org/).The source-code is also available. Therefore it is open source.
  • Object-Oriented Language - Python supports object oriented language and concepts of classes and objects come into existence.
  • Extensible - It implies that other languages such as C/C++ can be used to compile the code and thus it can be used further in our python code.
  • Large Standard Library - Python has a large and broad library and provides rich set of module and functions for rapid application development.
  • GUI Programming Support - Graphical user interfaces can be developed using Python. Integrated - It can be easily integrated with languages like C,C++,JAVA etc.

Python History

1.Python laid its foundation in the late 1980s. 2 The implementation of Python was started in the December 1989 by Guido Van Rossum at CWI in Netherland. 3 In February 1991, van Rossum published the code (labeled version 0.9.0) to alt.sources. 4 In 1994, Python 1.0 was released with new features like: lambda, map, filter, and reduce. 5 Python 2.0 added new features like: list comprehensions, garbage collection system. 6 On December 3, 2008, Python 3.0 (also called "Py3K") was released. It was designed to rectify fundamental flaw of the language. 7 ABC programming language is said to be the predecessor of Python language which was capable of Exception Handling and interfacing with Amoeba Operating System. 8 Python is influenced by following programming languages: (1) ABC language. (2) Modula-3.

Python Applications Area

develop your own website Python is known for its general purpose nature that makes it applicable in almost each domain of software development. Python as a whole can be used in any sphere of development.

Here, we are specifing applications areas where python can be applied.

  1. Web Applications - We can use Python to develop web applications. It provides libraries to handle internet protocols such as HTML and XML, JSON, Email processing, request, beautifulSoup, Feedparser etc. It also provides Frameworks such as Django, Pyramid, Flask etc to design and delelop web based applications. Some important developments are: PythonWikiEngines, Pocoo, PythonBlogSoftware etc.
  2. AI & Machine Learning - Python has Prebuilt Libraries like Numpy for scientific computation, Scipy for advanced computing and Pybrain for machine learning (Python Machine Learning) making it one of the best languages For AI.
  3. Desktop GUI Applications - Python provides Tk GUI library to develop user interface in python based application. Some other useful toolkits wxWidgets, Kivy, pyqt that are useable on several platforms. The Kivy is popular for writing multitouch applications.
  4. Software Development - Python is helpful for software development process. It works as a support language and can be used for build control and management, testing etc.
  5. Scientific and Numeric - Python is popular and widely used in scientific and numeric computing. Some useful library and package are SciPy, Pandas, IPython etc. SciPy is group of packages of engineering, science and mathematics.
  6. Business Applications - Python is used to build Bussiness applications like ERP and e-commerce systems. Tryton is a high level application platform.
  7. Console Based Application - We can use Python to develop console based applications. For example: IPython.
  8. Audio or Video based Applications - Python is awesome to perform multiple tasks and can be used to develop multimedia applications. Some of real applications are: TimPlayer, cplay etc
  9. 3D CAD Applications - To create CAD application Fandango is a real application which provides full features of CAD. Enterprise Applications - Python can be used to create applications which can be used within an Enterprise or an Organization. Some real time applications are: OpenErp, Tryton, Picalo etc.
  10. Applications for Images - Using Python several application can be developed for image. Applications developed are: VPython, Gogh, imgSeek etc.
  11. Games and 3D Graphics - PyGame, PyKyra are two frameworks for game-development with Python. Apart from these, we also get a variety of 3D-rendering libraries. If you’re one of those game-developers, you can check out PyWeek, a semi-annual game programming contest.

Hello World

Python is easy to learn and code and can be execute with python interpreter. We can also use Python interactive shell to test python code immediately. A simple hello world example is given below. Write below code in a file and save with .py extension. Python source file has .pyextension.

Writing the “Hello, World!” Program

To write the “Hello, World!” program, let’s open up a command-line text editor such as nano and create a new file: hello.py

Once the text file opens up in the terminal window we’ll type out our program :

print("Hello, World!")

Let’s break down the different components of the code.

  1. print() is a function that tells the computer to perform an action. We know it is a function because it uses parentheses. print() tells Python to display or output whatever we put in the parentheses. By default, this will output to the current terminal window.
  2. Some functions, like the print() function, are built-in functions included in Python by default. These built-in functions are always available for us to use in programs that we create. We can also define our own functions that we construct ourselves through other elements.
  3. Inside the parentheses of the print() function is a sequence of characters — Hello, World! — that is enclosed in quotation marks. Any characters that are inside of quotation marks are called a string.
  4. Once we are done writing our program, save the file and we can exit notepad.
Once you exit out of notpad you’ll return to your shell or cmd.

Running the “Hello, World!” Program

The hello.py program that you just created will cause your terminal to produce the following output:

Hello, World!

Congratulations! You have written the “Hello, World!” program in Python 3 . Since the program ran, you can now confirm that Python 3 is properly installed and that the program is syntactically correct.

this website is only for learn .

next content coming soon