PYTHON
PROGRAMMING
LANGUAGE
2
WHAT IS PYTHON?
Python is an interpreted, object-oriented,
high-level programming language with
dynamic semantics. Its high-level built in
data structures, combined with dynamic
typing and dynamic binding, make it very
attractive for Rapid Application Development,
as well as for use as a scripting or glue
language to connect existing components
together
3
COMPILER VS INTERPRETER
• A compiler is a translator that produces an output of low-level
language (like an assembly or machine language) by taking an input
of high-level language. It is basically a computer program used to
transform codes written in a programming language into
machine .The computer then processes the machine code for
performing the corresponding tasks.
• An interpreter is a program that executes the programming code
directly instead of just translating it into another format. It translates
and executes programming language statements one by one. An
interpreter takes less time to interpret a source program as
distinguished by a compiler.
4
WHY USE PYTHON?
o Python language is incredibly easy to
use and learn for new beginners and
newcomers.
o The python language is one of the
most accessible programming
languages available because it has
simplified syntax and not
complicated, which gives more
emphasis on natural language.
o Python codes can be easily written
and executed much faster than other
programming languages.
MAJOR USES
5
Artificial Intelligence
Data Analytics
Image Processing
Web Development
Automation/Scripting
Game Development
Database Programming
6
BUILT-IN OBJECT TYPES
Numbers
Strings
Lists
Dictionary
Tuples
VARIABLES IN PYTHON
8
LISTS
Lists are used to store multiple items in a
single variable.
Lists are created using square brackets.
List items are ordered, changeable, and
allow duplicate values.
List items are indexed, the first item has
index [0], the second item has
index [1] etc.
LIST OPERATIONS 9
10
DICTIONARY
A dictionary is a kind of data structure that stores
items in key-value pairs.
A key is a unique identifier for an item, and a value
is the data associated with that key.
Dictionaries are created using curly braces {}. The
key is on the left side of the colon (:) and the value
is on the right
There are two ways to access a dictionary element
in Python.
o The first is by using the get() method.
o The second way to access a dictionary
element is using the [] operator.
DICTIONARY OPERATIONS
11
TUPLES 12
Tuples are used to store multiple items in a single variable.
Tuple is one of 4 built-in data types in Python used to store
collections of data, the other 3 are List, Set, and Dictionary,
all with different qualities and usage.
A tuple is a collection which is ordered and unchangeable.
Tuples are written with round brackets.
13
DEFINING A FUNCTION
THANK YOU