SlideShare a Scribd company logo
PPT prepared by : Ankita A. Shirke
Python is a powerful general purpose programming language.
It has a simple easy to use syntax similar to the English
language.
Python has syntax that allows developers to write programs with
fewer lines than some other programming languages.It was
developed by Guido van Rossum in 1991.
It is used in web development , data science , creating software
prototypes, and so on.
Why Learn Python?
Python is currently the most widely used multi-purpose, high-
level programming language, which allows programming in
Object-Oriented and Procedural paradigms. Python programs
generally are smaller than other programming languages like
Java. Programmers have to type relatively less and the
indentation requirement of the language, makes them
readable all the time.
• LANGUAGE FEATURES
Interpreted
There are no separate compilation and execution
steps like C and C++.
Directly run the program from the source code.
Internally, Python converts the source code into
an intermediate form called byte codes which is
then translated into native language of specific
computer to run it.
No need to worry about linking and loading with
libraries, etc.
Python vs JAVA
Python
 No need to declare anything.
An assignment statement
binds a name to an object,
and the object can be of any
type.
 No type casting is required
when using container objects
 Uses Indentation for structuring
code
JAVA
 All variable names (along
with their types) must be
explicitly declared.
Attempting to assign an
object of the wrong type to a
variable name triggers a type
exception.
 Type casting is required
when using container
objects.
 Uses braces for structuring code
Python Variables
Variables is a named location used to store data in memory.
Variable names are case-sensitive.
Example
x = 5
y = "John"
print(x)
print(y)
Output
5
John
Python Data Types
Python data type is nothing but a text before
the variable which defines the type of value
stored in the variable.
Lets now explorer the standared data types
available in python.
Numbers
Int (integers like 3, 7, 23, 674 etc)
Long (long integers, which can be represented in
octal and hexadecimal formats, like – 0x17326L)
Float means decimal values ex. 6.72,67.2,10.00
Complex numbers like 20+2i,242j etc
List
List are used to store values of different data types in sequential
order.
 In simple, they are similar to arrays in C but unlike arrays, they
store values of various data types.
Lists are created using square brackets
Example
x = ["Java ", "C++", "Python"]
print(x)
Out Put
['Java ', 'C++', 'Python']
['Java ', 'C++', 'Python']
['Java ', 'C++', 'Python']
Tuple
 A Tuple is similar to that of a list.
 It also stores values of different data types. However, the major
difference is that we cannot change the size of the tuple once declared
or change the values of items stored in a tuple.
 This means a tuple is immutable.
 Tuples are written with round brackets.
x = ("apple", "banana", "cherry")
print(x)
Output
('apple', 'banana', 'cherry')
String
A string is a collection of a sequence of characters.
 print("Hello")
Strings are surrounded by either single quotation marks,
or double quotation marks.
'hello' is the same as "hello".
You can display a string literal with the print() function:
print("Hello")
Output
Hello
Set
 Sets are used to store multiple items in a single variable.
 A set is a collection which is unordered, unchangeable*, and unindexed.
 * Note: Set items are unchangeable, but you can remove items and add new
 Sets are written with curly brackets.
x = {"apple", "banana", "cherry"}
print(x)
Output
{'banana', 'apple', 'cherry'}
# Note: the set list is unordered, meaning: the items will appear in a random order.
# Refresh this page to see the change in the result.
Dictionary
 Dictionary is a collection of unordered key – value pairs.
 Dictionaries are written with curly brackets, and have keys and values:
x = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
print(x)
 Output
{'brand': 'Ford', 'model': 'Mustang', 'year': 1964}
In programming you often need to know if an expression is true or false.
You can evaluate any expression in python, and get one of two
answers, true or false.
When you compare two values, the expression is evaluated and python returns the
boolean answer:
logical computation . The value that
the operator operats on is called the
operand
e.g >>>6+8
14
Here + is operator and 6 and
8 are the operands
and 1 is output of the of the
operation.
 Arithmetic operators
 Assignment operators
 Comparison operators
 Logical operators
 Identity operators
 Membership operators
 Bitwise operators
Python divides the operators in the following groups
Arithmetic operators are used to
performing mathematical operations like
addition,subtraction, multiplication ,
etc.
Operator Name Example
+ Addition x + y
- Subtraction x - y
* Multiplication x * y
/ Division x / y
% Modulus x % y
** Exponentiation x ** y
// Floor division x // y
2. Logical Operator
Logical operators are used to
combining conditional statements.
Logical operators are the and , or ,
not.
Operator Description Example
and Returns True if both
statements are true
x < 5 and x < 10
or Returns True if one of
the statements is true
x < 5 or x < 4
not Reverse the result,
returns False if the
result is true
not(x < 5 and x < 10)
to assign values to variables.a=5 is a
simple assignment operator that assigns
the value 5 on the right to the variable
‘a’ on the left.
There are various compound operators in
Python like a+= 5 that adds to the
variable and later assigns the same . It
is equivalent to a = a + 5.
Comparison operators are used to
comparing values.
It returns either True or False
according to the condition.
Operator Name Example
== Equal x == y
!= Not equal x != y
> Greater than x > y
< Less than x < y
>= Greater than or
equal to
x >= y
<= Less than or equal to x <= y
is and is not are the identity
operators in Python . They are used
to check if two values ( or
variables ) are the located on the
same part of memory.
Operator Description Example
is not Returns true if both variables are
not the same object
x is not y
is Returns true if both variables are
the same object
x is y
in and not in are the membership
operators in Python. They are used to
test whether a value or variable is
found in a sequence(string, list , tuple , set and
dictionary).
In a dictionary , we can only test for
the presence of akey , not the value.
Operator Description Example
in Returns True if a sequence with the
specified value is present in the object
x in y
not in Returns True if a sequence with the
specified value is not present in the
object
x not in y
Bitwise operators act on operands as if
they were strings of binary digits .
Bitwise operators arer used to
comparing(binary) numbers . They operate
bit by bit , hence the name .For example , 2 is
10 in binary and 7 is 111.
Operator Name Description
& AND Sets each bit to 1 if both bits are 1
| OR Sets each bit to 1 if one of two bits is 1
^ XOR Sets each bit to 1 if only one of two bits is 1
~ NOT Inverts all the bits
<< Zero fill left shift Shift left by pushing zeros in from the right and let the leftmost
bits fall off
>> Signed right shift Shift right by pushing copies of the leftmost bit in from the left,
and let the rightmost bits fall off
Practicals in Python
Practical Output
x=“Hello World”
Print (x)
Hello world
X= 5
print (x)
5
x=“Python”
print (type (x))
Class ‘str,
x=5
print(type(x))
Class ‘int’
6+8
200-150
450*20
9000/45
9000//45
16**2
14
50
9000
200.0
200
256
a=9; b=2
c=a+b-a*b/a
Print (c)
9.0
Print 16//8 8
Python.pptx

More Related Content

Similar to Python.pptx

1_Python Basics.pdf
1_Python Basics.pdf1_Python Basics.pdf
1_Python Basics.pdf
MaheshGour5
 
Python - Module 1.ppt
Python - Module 1.pptPython - Module 1.ppt
Python - Module 1.ppt
jaba kumar
 
Python second ppt
Python second pptPython second ppt
Python second ppt
RaginiJain21
 
Python (Data Analysis) cleaning and visualize
Python (Data Analysis) cleaning and visualizePython (Data Analysis) cleaning and visualize
Python (Data Analysis) cleaning and visualize
IruolagbePius
 
UNIT II_python Programming_aditya College
UNIT II_python Programming_aditya CollegeUNIT II_python Programming_aditya College
UNIT II_python Programming_aditya College
Ramanamurthy Banda
 
Input processing and output in Python
Input processing and output in PythonInput processing and output in Python
Input processing and output in Python
Raajendra M
 
Input processing and output in Python
Input processing and output in PythonInput processing and output in Python
Input processing and output in Python
MSB Academy
 
An overview on python commands for solving the problems
An overview on python commands for solving the problemsAn overview on python commands for solving the problems
An overview on python commands for solving the problems
Ravikiran708913
 
PYTHON.pdf
PYTHON.pdfPYTHON.pdf
TOPIC-2-Expression Variable Assignment Statement.pdf
TOPIC-2-Expression Variable Assignment Statement.pdfTOPIC-2-Expression Variable Assignment Statement.pdf
TOPIC-2-Expression Variable Assignment Statement.pdf
EjazAlam23
 
Introduction to Python - Part Two
Introduction to Python - Part TwoIntroduction to Python - Part Two
Introduction to Python - Part Two
amiable_indian
 
python programming for beginners and advanced
python programming for beginners and advancedpython programming for beginners and advanced
python programming for beginners and advanced
granjith6
 
Python basic operators
Python   basic operatorsPython   basic operators
Python basic operators
Learnbay Datascience
 
The Awesome Python Class Part-3
The Awesome Python Class Part-3The Awesome Python Class Part-3
The Awesome Python Class Part-3
Binay Kumar Ray
 
modul-python-all.pptx
modul-python-all.pptxmodul-python-all.pptx
modul-python-all.pptx
Yusuf Ayuba
 
Python
PythonPython
PPt Revision of the basics of python1.pptx
PPt Revision of the basics of python1.pptxPPt Revision of the basics of python1.pptx
PPt Revision of the basics of python1.pptx
tcsonline1222
 
Python-01| Fundamentals
Python-01| FundamentalsPython-01| Fundamentals
Python-01| Fundamentals
Mohd Sajjad
 
python
pythonpython
python
ultragamer6
 

Similar to Python.pptx (20)

1_Python Basics.pdf
1_Python Basics.pdf1_Python Basics.pdf
1_Python Basics.pdf
 
Python - Module 1.ppt
Python - Module 1.pptPython - Module 1.ppt
Python - Module 1.ppt
 
Python second ppt
Python second pptPython second ppt
Python second ppt
 
Python (Data Analysis) cleaning and visualize
Python (Data Analysis) cleaning and visualizePython (Data Analysis) cleaning and visualize
Python (Data Analysis) cleaning and visualize
 
UNIT II_python Programming_aditya College
UNIT II_python Programming_aditya CollegeUNIT II_python Programming_aditya College
UNIT II_python Programming_aditya College
 
Input processing and output in Python
Input processing and output in PythonInput processing and output in Python
Input processing and output in Python
 
Input processing and output in Python
Input processing and output in PythonInput processing and output in Python
Input processing and output in Python
 
An overview on python commands for solving the problems
An overview on python commands for solving the problemsAn overview on python commands for solving the problems
An overview on python commands for solving the problems
 
PYTHON.pdf
PYTHON.pdfPYTHON.pdf
PYTHON.pdf
 
Python slide.1
Python slide.1Python slide.1
Python slide.1
 
TOPIC-2-Expression Variable Assignment Statement.pdf
TOPIC-2-Expression Variable Assignment Statement.pdfTOPIC-2-Expression Variable Assignment Statement.pdf
TOPIC-2-Expression Variable Assignment Statement.pdf
 
Introduction to Python - Part Two
Introduction to Python - Part TwoIntroduction to Python - Part Two
Introduction to Python - Part Two
 
python programming for beginners and advanced
python programming for beginners and advancedpython programming for beginners and advanced
python programming for beginners and advanced
 
Python basic operators
Python   basic operatorsPython   basic operators
Python basic operators
 
The Awesome Python Class Part-3
The Awesome Python Class Part-3The Awesome Python Class Part-3
The Awesome Python Class Part-3
 
modul-python-all.pptx
modul-python-all.pptxmodul-python-all.pptx
modul-python-all.pptx
 
Python
PythonPython
Python
 
PPt Revision of the basics of python1.pptx
PPt Revision of the basics of python1.pptxPPt Revision of the basics of python1.pptx
PPt Revision of the basics of python1.pptx
 
Python-01| Fundamentals
Python-01| FundamentalsPython-01| Fundamentals
Python-01| Fundamentals
 
python
pythonpython
python
 

More from Ankita Shirke

Cyber Safety and cyber security. Safety measures towards computer networks a...
Cyber Safety  and cyber security. Safety measures towards computer networks a...Cyber Safety  and cyber security. Safety measures towards computer networks a...
Cyber Safety and cyber security. Safety measures towards computer networks a...
Ankita Shirke
 
All about Sikkim.pptx
All about Sikkim.pptxAll about Sikkim.pptx
All about Sikkim.pptx
Ankita Shirke
 
ICT Skills.pptx
ICT Skills.pptxICT Skills.pptx
ICT Skills.pptx
Ankita Shirke
 
Green skills.pptx
Green skills.pptxGreen skills.pptx
Green skills.pptx
Ankita Shirke
 
Entrepreneurial Skills.pptx
Entrepreneurial Skills.pptxEntrepreneurial Skills.pptx
Entrepreneurial Skills.pptx
Ankita Shirke
 
Communication and Self Management skills.pptx
Communication and Self Management skills.pptxCommunication and Self Management skills.pptx
Communication and Self Management skills.pptx
Ankita Shirke
 
How to back up data.pptx
How to back up data.pptxHow to back up data.pptx
How to back up data.pptx
Ankita Shirke
 
Artificial Intelligence.pptx
Artificial Intelligence.pptxArtificial Intelligence.pptx
Artificial Intelligence.pptx
Ankita Shirke
 
Fundamentals of Computers.ppt
Fundamentals of Computers.pptFundamentals of Computers.ppt
Fundamentals of Computers.ppt
Ankita Shirke
 
Mail Merge.pptx
Mail Merge.pptxMail Merge.pptx
Mail Merge.pptx
Ankita Shirke
 
Computer Networking.pptx
Computer Networking.pptxComputer Networking.pptx
Computer Networking.pptx
Ankita Shirke
 
Computer worksheet
Computer worksheetComputer worksheet
Computer worksheet
Ankita Shirke
 
Mailmerge
Mailmerge Mailmerge
Mailmerge
Ankita Shirke
 
Computer periphirals
Computer periphiralsComputer periphirals
Computer periphirals
Ankita Shirke
 
More on Windows 10
More on Windows 10More on Windows 10
More on Windows 10
Ankita Shirke
 
Computer virus
Computer virusComputer virus
Computer virus
Ankita Shirke
 
E commerce, blogging and podcasting
E commerce, blogging and podcastingE commerce, blogging and podcasting
E commerce, blogging and podcasting
Ankita Shirke
 
Scratch programming introduction to game creation
Scratch programming  introduction to game creationScratch programming  introduction to game creation
Scratch programming introduction to game creation
Ankita Shirke
 
File management and data organisation
File management and data organisationFile management and data organisation
File management and data organisation
Ankita Shirke
 
Grade vi sub word processor tabular presentation unit 3
Grade vi  sub word processor   tabular presentation unit 3Grade vi  sub word processor   tabular presentation unit 3
Grade vi sub word processor tabular presentation unit 3
Ankita Shirke
 

More from Ankita Shirke (20)

Cyber Safety and cyber security. Safety measures towards computer networks a...
Cyber Safety  and cyber security. Safety measures towards computer networks a...Cyber Safety  and cyber security. Safety measures towards computer networks a...
Cyber Safety and cyber security. Safety measures towards computer networks a...
 
All about Sikkim.pptx
All about Sikkim.pptxAll about Sikkim.pptx
All about Sikkim.pptx
 
ICT Skills.pptx
ICT Skills.pptxICT Skills.pptx
ICT Skills.pptx
 
Green skills.pptx
Green skills.pptxGreen skills.pptx
Green skills.pptx
 
Entrepreneurial Skills.pptx
Entrepreneurial Skills.pptxEntrepreneurial Skills.pptx
Entrepreneurial Skills.pptx
 
Communication and Self Management skills.pptx
Communication and Self Management skills.pptxCommunication and Self Management skills.pptx
Communication and Self Management skills.pptx
 
How to back up data.pptx
How to back up data.pptxHow to back up data.pptx
How to back up data.pptx
 
Artificial Intelligence.pptx
Artificial Intelligence.pptxArtificial Intelligence.pptx
Artificial Intelligence.pptx
 
Fundamentals of Computers.ppt
Fundamentals of Computers.pptFundamentals of Computers.ppt
Fundamentals of Computers.ppt
 
Mail Merge.pptx
Mail Merge.pptxMail Merge.pptx
Mail Merge.pptx
 
Computer Networking.pptx
Computer Networking.pptxComputer Networking.pptx
Computer Networking.pptx
 
Computer worksheet
Computer worksheetComputer worksheet
Computer worksheet
 
Mailmerge
Mailmerge Mailmerge
Mailmerge
 
Computer periphirals
Computer periphiralsComputer periphirals
Computer periphirals
 
More on Windows 10
More on Windows 10More on Windows 10
More on Windows 10
 
Computer virus
Computer virusComputer virus
Computer virus
 
E commerce, blogging and podcasting
E commerce, blogging and podcastingE commerce, blogging and podcasting
E commerce, blogging and podcasting
 
Scratch programming introduction to game creation
Scratch programming  introduction to game creationScratch programming  introduction to game creation
Scratch programming introduction to game creation
 
File management and data organisation
File management and data organisationFile management and data organisation
File management and data organisation
 
Grade vi sub word processor tabular presentation unit 3
Grade vi  sub word processor   tabular presentation unit 3Grade vi  sub word processor   tabular presentation unit 3
Grade vi sub word processor tabular presentation unit 3
 

Recently uploaded

The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
Celine George
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
Col Mukteshwar Prasad
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
PedroFerreira53928
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
bennyroshan06
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
Celine George
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
Nguyen Thanh Tu Collection
 

Recently uploaded (20)

The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 

Python.pptx

  • 1. PPT prepared by : Ankita A. Shirke
  • 2. Python is a powerful general purpose programming language. It has a simple easy to use syntax similar to the English language. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.It was developed by Guido van Rossum in 1991. It is used in web development , data science , creating software prototypes, and so on.
  • 3. Why Learn Python? Python is currently the most widely used multi-purpose, high- level programming language, which allows programming in Object-Oriented and Procedural paradigms. Python programs generally are smaller than other programming languages like Java. Programmers have to type relatively less and the indentation requirement of the language, makes them readable all the time.
  • 4. • LANGUAGE FEATURES Interpreted There are no separate compilation and execution steps like C and C++. Directly run the program from the source code. Internally, Python converts the source code into an intermediate form called byte codes which is then translated into native language of specific computer to run it. No need to worry about linking and loading with libraries, etc.
  • 5. Python vs JAVA Python  No need to declare anything. An assignment statement binds a name to an object, and the object can be of any type.  No type casting is required when using container objects  Uses Indentation for structuring code JAVA  All variable names (along with their types) must be explicitly declared. Attempting to assign an object of the wrong type to a variable name triggers a type exception.  Type casting is required when using container objects.  Uses braces for structuring code
  • 6. Python Variables Variables is a named location used to store data in memory. Variable names are case-sensitive. Example x = 5 y = "John" print(x) print(y) Output 5 John
  • 7. Python Data Types Python data type is nothing but a text before the variable which defines the type of value stored in the variable. Lets now explorer the standared data types available in python.
  • 8. Numbers Int (integers like 3, 7, 23, 674 etc) Long (long integers, which can be represented in octal and hexadecimal formats, like – 0x17326L) Float means decimal values ex. 6.72,67.2,10.00 Complex numbers like 20+2i,242j etc
  • 9. List List are used to store values of different data types in sequential order.  In simple, they are similar to arrays in C but unlike arrays, they store values of various data types. Lists are created using square brackets Example x = ["Java ", "C++", "Python"] print(x) Out Put ['Java ', 'C++', 'Python'] ['Java ', 'C++', 'Python'] ['Java ', 'C++', 'Python']
  • 10. Tuple  A Tuple is similar to that of a list.  It also stores values of different data types. However, the major difference is that we cannot change the size of the tuple once declared or change the values of items stored in a tuple.  This means a tuple is immutable.  Tuples are written with round brackets. x = ("apple", "banana", "cherry") print(x) Output ('apple', 'banana', 'cherry')
  • 11. String A string is a collection of a sequence of characters.  print("Hello") Strings are surrounded by either single quotation marks, or double quotation marks. 'hello' is the same as "hello". You can display a string literal with the print() function: print("Hello") Output Hello
  • 12. Set  Sets are used to store multiple items in a single variable.  A set is a collection which is unordered, unchangeable*, and unindexed.  * Note: Set items are unchangeable, but you can remove items and add new  Sets are written with curly brackets. x = {"apple", "banana", "cherry"} print(x) Output {'banana', 'apple', 'cherry'} # Note: the set list is unordered, meaning: the items will appear in a random order. # Refresh this page to see the change in the result.
  • 13. Dictionary  Dictionary is a collection of unordered key – value pairs.  Dictionaries are written with curly brackets, and have keys and values: x = { "brand": "Ford", "model": "Mustang", "year": 1964 } print(x)  Output {'brand': 'Ford', 'model': 'Mustang', 'year': 1964}
  • 14. In programming you often need to know if an expression is true or false. You can evaluate any expression in python, and get one of two answers, true or false. When you compare two values, the expression is evaluated and python returns the boolean answer:
  • 15. logical computation . The value that the operator operats on is called the operand e.g >>>6+8 14 Here + is operator and 6 and 8 are the operands and 1 is output of the of the operation.
  • 16.  Arithmetic operators  Assignment operators  Comparison operators  Logical operators  Identity operators  Membership operators  Bitwise operators Python divides the operators in the following groups
  • 17. Arithmetic operators are used to performing mathematical operations like addition,subtraction, multiplication , etc. Operator Name Example + Addition x + y - Subtraction x - y * Multiplication x * y / Division x / y % Modulus x % y ** Exponentiation x ** y // Floor division x // y
  • 18. 2. Logical Operator Logical operators are used to combining conditional statements. Logical operators are the and , or , not. Operator Description Example and Returns True if both statements are true x < 5 and x < 10 or Returns True if one of the statements is true x < 5 or x < 4 not Reverse the result, returns False if the result is true not(x < 5 and x < 10)
  • 19. to assign values to variables.a=5 is a simple assignment operator that assigns the value 5 on the right to the variable ‘a’ on the left. There are various compound operators in Python like a+= 5 that adds to the variable and later assigns the same . It is equivalent to a = a + 5.
  • 20. Comparison operators are used to comparing values. It returns either True or False according to the condition. Operator Name Example == Equal x == y != Not equal x != y > Greater than x > y < Less than x < y >= Greater than or equal to x >= y <= Less than or equal to x <= y
  • 21. is and is not are the identity operators in Python . They are used to check if two values ( or variables ) are the located on the same part of memory. Operator Description Example is not Returns true if both variables are not the same object x is not y is Returns true if both variables are the same object x is y
  • 22. in and not in are the membership operators in Python. They are used to test whether a value or variable is found in a sequence(string, list , tuple , set and dictionary). In a dictionary , we can only test for the presence of akey , not the value. Operator Description Example in Returns True if a sequence with the specified value is present in the object x in y not in Returns True if a sequence with the specified value is not present in the object x not in y
  • 23. Bitwise operators act on operands as if they were strings of binary digits . Bitwise operators arer used to comparing(binary) numbers . They operate bit by bit , hence the name .For example , 2 is 10 in binary and 7 is 111. Operator Name Description & AND Sets each bit to 1 if both bits are 1 | OR Sets each bit to 1 if one of two bits is 1 ^ XOR Sets each bit to 1 if only one of two bits is 1 ~ NOT Inverts all the bits << Zero fill left shift Shift left by pushing zeros in from the right and let the leftmost bits fall off >> Signed right shift Shift right by pushing copies of the leftmost bit in from the left, and let the rightmost bits fall off
  • 24. Practicals in Python Practical Output x=“Hello World” Print (x) Hello world X= 5 print (x) 5 x=“Python” print (type (x)) Class ‘str, x=5 print(type(x)) Class ‘int’ 6+8 200-150 450*20 9000/45 9000//45 16**2 14 50 9000 200.0 200 256 a=9; b=2 c=a+b-a*b/a Print (c) 9.0 Print 16//8 8