1. Python
• Python is a popular programming language. It was created by Guido van Rossum, and
released in 1991.
• It is used for:
• web development (server-side),
• software development,
• mathematics,
• system scripting.
What can Python do?
• Python can be used on a server to create web applications.
• Python can be used alongside software to create workflows.
• Python can connect to database systems. It can also read and modify files.
• Python can be used to handle big data and perform complex mathematics.
2. Why Python?
• Python works on different platforms (Windows, Mac, Linux,
Raspberry Pi, etc).
• Python has a simple syntax similar to the English language.
• Python has syntax that allows developers to write programs with
fewer lines than some other programming languages.
• Python runs on an interpreter system, meaning that code can be
executed as soon as it is written. This means that prototyping can be
very quick.
• Python can be treated in a procedural way, an object-oriented way or
a functional way.
3. Getting Python
• The most up-to-date and current source code, binaries,
documentation, news, etc., is available on the official website of
Python https://www.python.org/
4. Python IDLE
• Every Python installation comes with an Integrated Development and
Learning Environment. Helps you write code more efficiently
5. Applications of Python
• Python is known for its general-purpose nature that makes it
applicable in almost every domain of software development. Python
makes its presence in every emerging field. It is the fastest-growing
programming language and can develop any application.
6.
7. 1) Web Applications
• Python to develop web applications. It provides libraries to handle internet
protocols such as HTML and XML, JSON, Email processing, request,
beautifulSoup, Feedparser, etc. One of Python web-framework named
Django is used on Instagram.
2) Desktop GUI Applications
The GUI stands for the Graphical User Interface, which provides a smooth
interaction to any application. Python provides a Tk GUI library to develop a
user interface. Some popular GUI libraries are given below.
• Tkinter or Tk
• wxWidgetM
• Pyside
8. • Software Development
Python is useful for the software development process. It works as a support
language and can be used to build control and management, testing, etc.
• Scientific and Numeric
Python language is the most suitable language for Artificial intelligence or
machine learning. It consists of many scientific and mathematical libraries,
which makes easy to solve complex calculations.
Implementing machine learning algorithms require complex mathematical
calculation. Python has many libraries for scientific and numeric such as
Numpy, Pandas, Scipy, Scikit-learn, etc.
• Business Applications
Business Applications differ from standard applications. E-commerce and
ERP are an example of a business application. This kind of application
requires extensively, scalability and readability, and Python provides all these
features.
9. • Audio or Video-based Applications
Python is flexible to perform multiple tasks and can be used to create multimedia
applications. Some multimedia applications which are made by using Python
are TimPlayer, cplay, etc. The few multimedia libraries are given below.
• Gstreamer
• Pyglet
• QT Phonon
• Image Processing Application
Python contains many libraries that are used to work with the image. The image
can be manipulated according to our requirements. Some libraries of image
processing are given below.
• OpenCV
• Pillow
• SimpleITK
10. Python Operators(W3schools)
Operators are used to perform operations on variables and values.
• Python divides the operators in the following groups
• Arithmetic operators
• Assignment Operators
• Comparison Operators
• Logical Operators
• Identity Operators
• Membership Operators
• Bitwise Operators
11. Python Data Types (Geeksforgeeks)
• Data types are the classification or categorization of data items. It
represents the kind of value that tells what operations can be
performed on a particular data.
12. Numeric
In Python, numeric data type represent the data which has numeric value. Numeric value can be integer, floating number or even
complex numbers. These values are defined as int, float and complex class in Python.
• Integers – This value is represented by int class. It contains positive or negative whole numbers
(without fraction or decimal). In Python there is no limit to how long an integer value can be.
• Float – This value is represented by float class. It is a real number with floating point representation. It
is specified by a decimal point. Optionally, the character e or E followed by a positive or negative
integer may be appended to specify scientific notation.
• Complex Numbers – Complex number is represented by complex class. It is specified as (real part) +
(imaginary part)j. For example – 2+3j
13. Sequence Type
• Sequence is the ordered collection of similar or different data types.
Sequences allows to store multiple values in an organized and efficient
fashion. There are several sequence types in Python –
• String
• List
• Tuple
• 1) String
• String is the collection of one or more characters put in a single quote,
double quote or triple quote. It is represented by str class.
• Creating String
• Strings in Python can be created using single quotes or double quotes or
even triple quotes.
14. • Accessing elements of String
• Individual characters of a String can be accessed by using the method
of Indexing. Indexing allows negative address references to access
characters from the back of the String, e.g. -1 refers to the last
character, -2 refers to the second last character and so on.
15. 2) List
• Lists are just like the arrays, declared in other languages which is a ordered collection of data. It is
very flexible as the items in a list do not need to be of the same type.
• Creating List
• Lists in python can be created by just placing the sequence inside the square bracket [].
List = []
print("Initial blank List: ")
print(List)
List with multiple values
List = ["Geeks", "For", "Geeks"]
print("nList containing multiple values: ")
print(List[0])
print(List[2])
To calculate the length of the list
Print(len(List))
16. Accessing elements of List
Accessing a element using negative indexing
print("Accessing element using negative indexing")
print the last element of list
print(List[-1])
print the third last element of list
print(List[-3])
17. 3) Tuple
• Tuple is also an ordered collection of Python objects. The only
difference between tuple and list is that tuples are immutable i.e.
tuples cannot be modified after it is created. It is represented by tuple
class.
• Creating Tuple
• Tuples are created by placing a sequence of values separated by
‘comma’ with or without the use of parentheses for grouping of the
data sequence