SlideShare une entreprise Scribd logo
1  sur  18
Télécharger pour lire hors ligne
BASICS OF PYTHON
PROGRAMMING
Prepared by
Mrs. Deepa S.Rengade
Asstt. Prof.
python
• Simple
– Python is a simple and minimalistic language in nature
– Reading a good python program should be like reading
English
– Its Pseudo-code nature allows one to concentrate on the
problem rather than the language
• Easy to Learn
• Free & Open source
– Freely distributed and Open source
– Maintained by the Python community
• High Level Language –memory management
• Portable – *runs on anything c code will
10/18/19 Programming and problem solving 2
python
• Interpreted
– You run the program straight from the source code.
– Python program Bytecode a platforms native language
– You can just copy over your code to another system and it will
auto-magically work! *with python platform
• Object-Oriented
– Simple and additionally supports procedural programming
• Extensible – easily import other code
• Embeddable –easily place your code in non-python programs
• Extensive libraries
– (i.e. reg. expressions, doc generation, CGI, ftp, web browsers,
ZIP, WAV, cryptography, etc...) (wxPython, Twisted, Python
Imaging library)
10/18/19 Programming and problem solving 3
python Timeline/History
• Python was conceived in the late 1980s.
– Guido van Rossum, Benevolent Dictator For Life
– Rossum is Dutch, born in Netherlands, Christmas break
bored, big fan of Monty python’s Flying Circus
– Descendant of ABC, he wrote glob() func in UNIX
– M.D. @ U of Amsterdam, worked for CWI, NIST, CNRI, Google
– Also, helped develop the ABC programming language
• In 1991 python 0.9.0 was published and reached the
masses through alt.sources
• In January of 1994 python 1.0 was released
– Functional programming tools like lambda, map, filter, and
reduce
– comp.lang.python formed, greatly increasing python’s
userbase
10/18/19 Programming and problem solving 4
python Timeline/History
• In 1995, python 1.2 was released.
• By version 1.4 python had several new features
– Keyword arguments (similar to those of common lisp)
– Built-in support for complex numbers
– Basic form of data-hiding through name mangling
(easily bypassed however)
• Computer Programming for Everybody (CP4E) initiative
– Make programming accessible to more people, with basic “literacy”
similar to those required for English and math skills for some jobs.
– Project was funded by DARPA
– CP4E was inactive as of 2007, not so much a concern to get
employees programming “literate”
10/18/19 Programming and problem solving 5
python Timeline/History
• In 2000, Python 2.0 was released.
– Introduced list comprehensions similar to Haskells
– Introduced garbage collection
• In 2001, Python 2.2 was released.
– Included unification of types and classes into one
hierarchy, making pythons object model purely
Object-oriented
– Generators were added(function-like iterator
behavior)
• Standards
– http://www.python.org/dev/peps/pep-0008/
10/18/19 Programming and problem solving 6
Future of Python
• One of the fastest growing language
• Huge user base and constantly growing
• Stable language that is going to stay for long
• Most preferred language of companies such
as Nokia, Youtube,Google,NASA for its easy
syntax
• High speed dynamic language
• Supports for multiple programming
paradigms.
• Has bright future ahead of it supported by
huge community of OS developers
10/18/19 Programming and problem solving 7
Writing& Executing first Python
Program
• Download Python from www.python.org
• Once installed, Python console can be
accessed through
– Command line and running python interpreter
– GUI Software comes with python called IDLE
• Writing program:
– Open an Editor
– write instructions
– save it with extension.py
– Run the interpreter with the commend
python program_name.py
10/18/19 Programming and problem solving 8
Literal Constants
• Value of literal constant directly used in program
• E.g. 7,3,9,’a’,”hello” are literal constant
• They represents itself and nothing else
• Its value cannot be changed
• Numbers:integers,long integers,floating
points,complex numbers
• String:a groupof characters,immutable
• Escape sequences
• E.g a=rings bell, f=prints form feed
character,n=newline,t=prints tab,o=octal
value,x=hex value,=backslash,’=single
quote,”=doublequote
10/18/19 Programming and problem solving 9
Variables and identifiers
• Variables are reserved memory locations that
stores values.
• Each variable is given appropriate name.
• variables are example of identifiers
• Identifiers are names given to identify something.
• So it can be a variable, function, class, modules
etc.
• Valid identifiers: sum,_myvar,num1,var_20,a etc.
• Invalid identifiers:1num,my-var,%check,basic
sal .
• Python is a case sensitive language.
10/18/19 Programming and problem solving 10
Datatypes
• Variables can hold values of different types
called datatypes.
• Numbers, strings, list, tuple, dictionary
• Initializing values to variables e.g.
a=7,code=‘a’,amt=123.45 etc.
• Multiple assignment e.g. a=b=flag=0
• Assign different values to multiple variables
simultaneously e.g. sum,a,b,msg=0,3,5,”rest”
• Multiple statements on a single line usingsemi
colon.
• Boolean: datatype in python and can have
one of two values-True or False.
10/18/19 Programming and problem solving 11
Input Operation and
Comments
• Input() fuction= to take input from user
• It always take input as a string
• E.g. name=input(“what is your name?”)
• E.g age=input(“enter your age:”)
• Comments are non executable statements
• Added to describe staatements of program
• Characters following the# and upto end of
line are part of comment
• E.g. print(“hello”) #to display hello
• Output: hello
10/18/19 Programming and problem solving 12
Reserved words
• In every programming language there are
certain words which have predefined
meaning called keywords or reserved words
cannot be used for naming identifiers.
• E.g.break,class,if,else,elif,for,from,print,retu
rn
• All the python keywords contain lowercase
letters only.
• 33 keywords in python 3.7.
10/18/19 Programming and problem solving 13
Indentation
• Indentation is used to define a block of
code
• Block of code begins with indentation and
ends with the first unindented line.
• Usually four white spaces are referred for
indentation.
• E.g
no=10
If(no==10):
print(“no is 10”)
Output : no is 10
10/18/19 Programming and problem solving 14
Operators and Expressions
• Arithmetic operators: +,-,*,/,%,**,//
• Assignment operators : =,+=,-=,*=,/=,
%=,//=, **=,&=,|=, ^=,>>=, <<=
• Comparison operators: ==,!
=,>,<,>=,<=
• Logical operators:
and –returns true if both statements are true
or- returns true if one of the statement is true
not-returns false if the result is true
10/18/19 Programming and problem solving 15
Operators and Expressions
• Identity operators:
is – returns true if both variables are the same object
Is not – returns true if both variables are not the same object
• Membership operators:
In – returns true if a sequence with the specified value is
present in the object
Not in-– returns true if a sequence with the specified value is
not present in the object
• Bitwise operators:
• & AND
• | OR
• ^ XOR
• ~ NOT
• << left shift
• >> right shift
10/18/19 Programming and problem solving 16
Expressions in Python
• An expression is combination of
value, variables and operators.
• Expression appear on the right hand
side of assignment operator.
• E.g. add=a+b
• Sub=a-b
10/18/19 Programming and problem solving 17
THANK YOU
10/18/19 Programming and problem solving 18

Contenu connexe

Tendances

Python quick guide1
Python quick guide1Python quick guide1
Python quick guide1
Kanchilug
 
Python Programming Language
Python Programming LanguagePython Programming Language
Python Programming Language
Laxman Puri
 

Tendances (20)

Programming with Python: Week 1
Programming with Python: Week 1Programming with Python: Week 1
Programming with Python: Week 1
 
Python Programming
Python ProgrammingPython Programming
Python Programming
 
Python
PythonPython
Python
 
Python: The Programmer's Lingua Franca
Python: The Programmer's Lingua FrancaPython: The Programmer's Lingua Franca
Python: The Programmer's Lingua Franca
 
Python quick guide1
Python quick guide1Python quick guide1
Python quick guide1
 
20120314 changa-python-workshop
20120314 changa-python-workshop20120314 changa-python-workshop
20120314 changa-python-workshop
 
Summer Training Project On Python Programming
Summer Training Project On Python ProgrammingSummer Training Project On Python Programming
Summer Training Project On Python Programming
 
Before Starting Python Programming Language
Before Starting Python Programming LanguageBefore Starting Python Programming Language
Before Starting Python Programming Language
 
Python for All
Python for All Python for All
Python for All
 
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYAChapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
 
Python Programming Language
Python Programming LanguagePython Programming Language
Python Programming Language
 
Programming
ProgrammingProgramming
Programming
 
Python - An Introduction
Python - An IntroductionPython - An Introduction
Python - An Introduction
 
Introduction to python programming
Introduction to python programmingIntroduction to python programming
Introduction to python programming
 
Type hints in python & mypy
Type hints in python & mypyType hints in python & mypy
Type hints in python & mypy
 
Python presentation
Python presentationPython presentation
Python presentation
 
Introduction to Python Programming
Introduction to Python ProgrammingIntroduction to Python Programming
Introduction to Python Programming
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Getting Started with Python
Getting Started with PythonGetting Started with Python
Getting Started with Python
 
Introduction to Python Programing
Introduction to Python ProgramingIntroduction to Python Programing
Introduction to Python Programing
 

Similaire à Unit1 pps

Similaire à Unit1 pps (20)

Plc part 1
Plc part 1Plc part 1
Plc part 1
 
Presentation.pptx
Presentation.pptxPresentation.pptx
Presentation.pptx
 
Presentation.pptx
Presentation.pptxPresentation.pptx
Presentation.pptx
 
Python Programming1.ppt
Python Programming1.pptPython Programming1.ppt
Python Programming1.ppt
 
Python Module-1.1.pdf
Python Module-1.1.pdfPython Module-1.1.pdf
Python Module-1.1.pdf
 
2015 bioinformatics python_introduction_wim_vancriekinge_vfinal
2015 bioinformatics python_introduction_wim_vancriekinge_vfinal2015 bioinformatics python_introduction_wim_vancriekinge_vfinal
2015 bioinformatics python_introduction_wim_vancriekinge_vfinal
 
P1 2018 python
P1 2018 pythonP1 2018 python
P1 2018 python
 
Python_Introduction&DataType.pptx
Python_Introduction&DataType.pptxPython_Introduction&DataType.pptx
Python_Introduction&DataType.pptx
 
pythontraining-201jn026043638.pptx
pythontraining-201jn026043638.pptxpythontraining-201jn026043638.pptx
pythontraining-201jn026043638.pptx
 
Python training
Python trainingPython training
Python training
 
P1 2017 python
P1 2017 pythonP1 2017 python
P1 2017 python
 
BASIC_INTRODUCTION_TO_PYTHON_PROGRAMMING.pdf
BASIC_INTRODUCTION_TO_PYTHON_PROGRAMMING.pdfBASIC_INTRODUCTION_TO_PYTHON_PROGRAMMING.pdf
BASIC_INTRODUCTION_TO_PYTHON_PROGRAMMING.pdf
 
MODULE 1.pptx
MODULE 1.pptxMODULE 1.pptx
MODULE 1.pptx
 
Python basics
Python basicsPython basics
Python basics
 
2016 bioinformatics i_python_part_1_wim_vancriekinge
2016 bioinformatics i_python_part_1_wim_vancriekinge2016 bioinformatics i_python_part_1_wim_vancriekinge
2016 bioinformatics i_python_part_1_wim_vancriekinge
 
4_Introduction to Python Programming.pptx
4_Introduction to Python Programming.pptx4_Introduction to Python Programming.pptx
4_Introduction to Python Programming.pptx
 
Python presentation of Government Engineering College Aurangabad, Bihar
Python presentation of Government Engineering College Aurangabad, BiharPython presentation of Government Engineering College Aurangabad, Bihar
Python presentation of Government Engineering College Aurangabad, Bihar
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Python programming
Python programmingPython programming
Python programming
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unit
 

Dernier

Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 

Dernier (20)

Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 

Unit1 pps

  • 1. BASICS OF PYTHON PROGRAMMING Prepared by Mrs. Deepa S.Rengade Asstt. Prof.
  • 2. python • Simple – Python is a simple and minimalistic language in nature – Reading a good python program should be like reading English – Its Pseudo-code nature allows one to concentrate on the problem rather than the language • Easy to Learn • Free & Open source – Freely distributed and Open source – Maintained by the Python community • High Level Language –memory management • Portable – *runs on anything c code will 10/18/19 Programming and problem solving 2
  • 3. python • Interpreted – You run the program straight from the source code. – Python program Bytecode a platforms native language – You can just copy over your code to another system and it will auto-magically work! *with python platform • Object-Oriented – Simple and additionally supports procedural programming • Extensible – easily import other code • Embeddable –easily place your code in non-python programs • Extensive libraries – (i.e. reg. expressions, doc generation, CGI, ftp, web browsers, ZIP, WAV, cryptography, etc...) (wxPython, Twisted, Python Imaging library) 10/18/19 Programming and problem solving 3
  • 4. python Timeline/History • Python was conceived in the late 1980s. – Guido van Rossum, Benevolent Dictator For Life – Rossum is Dutch, born in Netherlands, Christmas break bored, big fan of Monty python’s Flying Circus – Descendant of ABC, he wrote glob() func in UNIX – M.D. @ U of Amsterdam, worked for CWI, NIST, CNRI, Google – Also, helped develop the ABC programming language • In 1991 python 0.9.0 was published and reached the masses through alt.sources • In January of 1994 python 1.0 was released – Functional programming tools like lambda, map, filter, and reduce – comp.lang.python formed, greatly increasing python’s userbase 10/18/19 Programming and problem solving 4
  • 5. python Timeline/History • In 1995, python 1.2 was released. • By version 1.4 python had several new features – Keyword arguments (similar to those of common lisp) – Built-in support for complex numbers – Basic form of data-hiding through name mangling (easily bypassed however) • Computer Programming for Everybody (CP4E) initiative – Make programming accessible to more people, with basic “literacy” similar to those required for English and math skills for some jobs. – Project was funded by DARPA – CP4E was inactive as of 2007, not so much a concern to get employees programming “literate” 10/18/19 Programming and problem solving 5
  • 6. python Timeline/History • In 2000, Python 2.0 was released. – Introduced list comprehensions similar to Haskells – Introduced garbage collection • In 2001, Python 2.2 was released. – Included unification of types and classes into one hierarchy, making pythons object model purely Object-oriented – Generators were added(function-like iterator behavior) • Standards – http://www.python.org/dev/peps/pep-0008/ 10/18/19 Programming and problem solving 6
  • 7. Future of Python • One of the fastest growing language • Huge user base and constantly growing • Stable language that is going to stay for long • Most preferred language of companies such as Nokia, Youtube,Google,NASA for its easy syntax • High speed dynamic language • Supports for multiple programming paradigms. • Has bright future ahead of it supported by huge community of OS developers 10/18/19 Programming and problem solving 7
  • 8. Writing& Executing first Python Program • Download Python from www.python.org • Once installed, Python console can be accessed through – Command line and running python interpreter – GUI Software comes with python called IDLE • Writing program: – Open an Editor – write instructions – save it with extension.py – Run the interpreter with the commend python program_name.py 10/18/19 Programming and problem solving 8
  • 9. Literal Constants • Value of literal constant directly used in program • E.g. 7,3,9,’a’,”hello” are literal constant • They represents itself and nothing else • Its value cannot be changed • Numbers:integers,long integers,floating points,complex numbers • String:a groupof characters,immutable • Escape sequences • E.g a=rings bell, f=prints form feed character,n=newline,t=prints tab,o=octal value,x=hex value,=backslash,’=single quote,”=doublequote 10/18/19 Programming and problem solving 9
  • 10. Variables and identifiers • Variables are reserved memory locations that stores values. • Each variable is given appropriate name. • variables are example of identifiers • Identifiers are names given to identify something. • So it can be a variable, function, class, modules etc. • Valid identifiers: sum,_myvar,num1,var_20,a etc. • Invalid identifiers:1num,my-var,%check,basic sal . • Python is a case sensitive language. 10/18/19 Programming and problem solving 10
  • 11. Datatypes • Variables can hold values of different types called datatypes. • Numbers, strings, list, tuple, dictionary • Initializing values to variables e.g. a=7,code=‘a’,amt=123.45 etc. • Multiple assignment e.g. a=b=flag=0 • Assign different values to multiple variables simultaneously e.g. sum,a,b,msg=0,3,5,”rest” • Multiple statements on a single line usingsemi colon. • Boolean: datatype in python and can have one of two values-True or False. 10/18/19 Programming and problem solving 11
  • 12. Input Operation and Comments • Input() fuction= to take input from user • It always take input as a string • E.g. name=input(“what is your name?”) • E.g age=input(“enter your age:”) • Comments are non executable statements • Added to describe staatements of program • Characters following the# and upto end of line are part of comment • E.g. print(“hello”) #to display hello • Output: hello 10/18/19 Programming and problem solving 12
  • 13. Reserved words • In every programming language there are certain words which have predefined meaning called keywords or reserved words cannot be used for naming identifiers. • E.g.break,class,if,else,elif,for,from,print,retu rn • All the python keywords contain lowercase letters only. • 33 keywords in python 3.7. 10/18/19 Programming and problem solving 13
  • 14. Indentation • Indentation is used to define a block of code • Block of code begins with indentation and ends with the first unindented line. • Usually four white spaces are referred for indentation. • E.g no=10 If(no==10): print(“no is 10”) Output : no is 10 10/18/19 Programming and problem solving 14
  • 15. Operators and Expressions • Arithmetic operators: +,-,*,/,%,**,// • Assignment operators : =,+=,-=,*=,/=, %=,//=, **=,&=,|=, ^=,>>=, <<= • Comparison operators: ==,! =,>,<,>=,<= • Logical operators: and –returns true if both statements are true or- returns true if one of the statement is true not-returns false if the result is true 10/18/19 Programming and problem solving 15
  • 16. Operators and Expressions • Identity operators: is – returns true if both variables are the same object Is not – returns true if both variables are not the same object • Membership operators: In – returns true if a sequence with the specified value is present in the object Not in-– returns true if a sequence with the specified value is not present in the object • Bitwise operators: • & AND • | OR • ^ XOR • ~ NOT • << left shift • >> right shift 10/18/19 Programming and problem solving 16
  • 17. Expressions in Python • An expression is combination of value, variables and operators. • Expression appear on the right hand side of assignment operator. • E.g. add=a+b • Sub=a-b 10/18/19 Programming and problem solving 17
  • 18. THANK YOU 10/18/19 Programming and problem solving 18