Python is an open source scripting language, which is high-level, interpreted, interactive and object-oriented. It is designed to be highly readable. The syntax of Python language is easy to understand and uses English keywords frequently.
In this section, we will learn about the different features of Python language.
Python is processed at runtime using the interpreter. There is no need to compile program before execution. It is similar to PERL and PHP.
Python follows object-oriented style and design patterns. It includes class definition with various features like encapsulation, polymorphism and many more.
Python code written in Windows operating system and can be used in Mac operating system. The code can be reused and portable as per the requirements.
Python syntax is easy to understand and code. Any developer can understand the syntax of Python within few hours. Python can be described as “programmer-friendly”
If needed, a user can write some of Python code in C language as well. It is also possible to put python code in source code in different languages like C++. This makes Python an extensible language.
Consider the following important points related to Python programming language −
It includes functional and structured programming methods as well as object-oriented programming methods.
It can be used as scripting language or as a programming language.
It includes automatic garbage collection.
It includes high-level dynamic data types and supports various dynamic type checking.
Python includes a feature of integration with C, C++ and languages like Java.
To download Python language in your system, follow this link −
https://www.python.org/downloads/It includes packages for various operating systems like Windows, MacOS and Linux distributions.
In this section, we will learn in brief about a few important tools in Python.
The basic declaration of strings is as follows −
str = 'Hello World!'
The lists of python can be declared as compound data types separated by commas and enclosed within square brackets ([]).
list = [ 'abcd', 786 , 2.23, 'john', 70.2 ] tinylist = [123, 'john']
A tuple is dynamic data type of Python, which consists of number of values separated by commas. Tuples are enclosed with parentheses.
tinytuple = (123, 'john')
Python dictionary is a type of hash table. A dictionary key can be almost any data type of Python. The data types are usually numbers or strings.
tinydict = {'name': 'omkar','code':6734, 'dept': 'sales'}
Python helps in constituting a design pattern using the following parameters −