SlideShare a Scribd company logo
1 of 12
Download to read offline
KONGUNADU COLLEGE OF ENGINEERING AND TECHNOLOGY
(AUTONOMOUS)
NAMAKKAL- TRICHY MAIN ROAD, THOTTIAM
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING
Mr.S.HARI KUMAR
Assistant Professor / ECE
KNCET
20EC503PE-INTERNET OF THINGS
(REGULATION-KNCET - UGR2020)
UNIT III - IoT LOGICAL DESIGN USING PYTHON
Python
Python
• Python is a general-purpose, high level and object-oriented programming language. Python is
an interpreted scripting language also.
• Python is a case-sensitive language. This means, Variable and variable are not the same.
• Multiple words can be separated using an under score, like this is_a_long_variable.
• Python program can be saved it with .py extension.
• Guido Van Rossum is known as the founder of Python programming.
The following programming languages influence Python:
• ABC language.
• Modula-3
Python Applications
Python Applications
• Desktop Applications
• Web Applications
• Data Science
• Artificial Intelligence
• Machine Learning
• Scientific Computing
• Robotics
• Internet of Things (IoT)
• Gaming
• Mobile Apps
• Data Analysis and Preprocessing
Characteristics of Python
Multi-paradigm programming language
• Python supports more than one programming paradigms including object-oriented
programming and structured programming
Interpreted Language
• Python is an interpreted language and does not require an explicit compilation step. The
Python interpreter executes the program source code directly, statement by statement, as a
processor or scripting engine does.
Interactive Language
• Python provides an interactive mode in which the user can submit commands at the Python
prompt and interact with the interpreter directly.
Easy-to-learn, read and maintain
• Python is a minimalistic language with relatively few keywords, uses English key words and
has fewer syntactical constructions as compared to other languages. Reading Python programs
feels like English with pseudo-code like constructs. Python is easy to learn yet an extremely
powerful language for a wide range of applications.
Characteristics of Python
Object and Procedure Oriented
• Python supports both procedure-oriented programming and object-oriented programming.
Procedure oriented paradigm allows programs to be written around procedures or functions
that allow reuse of code. Procedure oriented paradigm allows programs to be written around
objects that include both data and functionality.
Extendable
• Python is an extendable language and allows integration of low-level modules written in
languages such as C/C++. This is useful when you want to speed up a critical portion of a
program.
Scalable
• Due to the minimalistic nature of Python, it provides a manageable structure for large
programs.
Portable
• Since Python is an interpreted language, programmers do not have to worry about
compilation, linking and loading of programs. Python programs can be directly executed
from source.
Python Operators
Python Operators
• Arithmetic operators
• Comparison operators
• Assignment Operators
• Logical Operators
• Bitwise Operators
• Membership Operators
• Identity Operators
Arithmetic operators
Operator Meaning Example
+ Add two operands or unary plus x + y+ 2
- Subtract right operand from the left or unary minus x - y- 2
* Multiply two operands x * y
/ Divide left operand by the right one (always results into float) x / y
% Modulus - remainder of the division of left operand by the right
x % y (remainder
of x/y)
//
Floor division - division that results into whole number adjusted to
the left in the number line
x // y
** Exponent - left operand raised to the power of right
x**y (x to the
power y)
Arithmetic operators
Example
x = 15
y = 4
print('x + y =',x+y)
print('x - y =',x-y)
print('x * y =',x*y)
print('x / y =',x/y)
print('x // y =',x//y)
print('x ** y =',x**y)
Output:
x + y = 19
x - y = 11
x * y = 60
x / y = 3.75
x // y = 3
x ** y = 50625
Comparison operators
Operator Meaning Example
> Greater than - True if left operand is greater than the right x > y
< Less than - True if left operand is less than the right x < y
== Equal to - True if both operands are equal x == y
!= Not equal to - True if operands are not equal x != y
>=
Greater than or equal to - True if left operand is greater than or
equal to the right
x >= y
<=
Less than or equal to - True if left operand is less than or equal to
the right
x <= y
Comparison operators
Example
x = 10
y = 12
print('x > y is',x>y)
print('x < y is',x<y)
print('x == y is',x==y)
print('x != y is',x!=y)
print('x >= y is',x>=y)
print('x <= y is',x<=y)
Output:
x > y is False
x < y is True
x == y is False
x != y is True
x >= y is False
x <= y is True
Logical operators
Operator Meaning Example
and True if both the operands are true x and y
or True if either of the operands is true x or y
not True if operand is false (complements the operand) not x
Logical operators
Example
x = True
y = False
print('x and y is',x and y)
print('x or y is',x or y)
print('not x is',not x)
Output:
x and y is False
x or y is True
not x is False

More Related Content

Similar to UNIT 3.pptx

FUNDAMENTALS OF PYTHON LANGUAGE
 FUNDAMENTALS OF PYTHON LANGUAGE  FUNDAMENTALS OF PYTHON LANGUAGE
FUNDAMENTALS OF PYTHON LANGUAGE Saraswathi Murugan
 
python PPT Session 1.pptx
python PPT Session 1.pptxpython PPT Session 1.pptx
python PPT Session 1.pptxRobertHook14
 
First Steps in Python Programming
First Steps in Python ProgrammingFirst Steps in Python Programming
First Steps in Python ProgrammingDozie Agbo
 
Automation Testing theory notes.pptx
Automation Testing theory notes.pptxAutomation Testing theory notes.pptx
Automation Testing theory notes.pptxNileshBorkar12
 
Python functional programming
Python functional programmingPython functional programming
Python functional programmingGeison Goes
 
Python Basics
Python BasicsPython Basics
Python BasicsPooja B S
 
Fundamentals of Data Structures Unit 1.pptx
Fundamentals of Data Structures Unit 1.pptxFundamentals of Data Structures Unit 1.pptx
Fundamentals of Data Structures Unit 1.pptxVigneshkumar Ponnusamy
 
Introduction to programming with python
Introduction to programming with pythonIntroduction to programming with python
Introduction to programming with pythonPorimol Chandro
 
Python Programming | JNTUK | UNIT 1 | Lecture 5
Python Programming | JNTUK | UNIT 1 | Lecture 5Python Programming | JNTUK | UNIT 1 | Lecture 5
Python Programming | JNTUK | UNIT 1 | Lecture 5FabMinds
 
modul-python-all.pptx
modul-python-all.pptxmodul-python-all.pptx
modul-python-all.pptxYusuf Ayuba
 
Presentation on python
Presentation on pythonPresentation on python
Presentation on pythonwilliam john
 
PROBLEM SOLVING TECHNIQUES USING PYTHON.pptx
PROBLEM SOLVING TECHNIQUES USING PYTHON.pptxPROBLEM SOLVING TECHNIQUES USING PYTHON.pptx
PROBLEM SOLVING TECHNIQUES USING PYTHON.pptxBELMERGLADSONAsstPro
 
python presntation 2.pptx
python presntation 2.pptxpython presntation 2.pptx
python presntation 2.pptxArpittripathi45
 
علم البيانات - Data Sience
علم البيانات - Data Sience علم البيانات - Data Sience
علم البيانات - Data Sience App Ttrainers .com
 
Basic concept of Python.pptx includes design tool, identifier, variables.
Basic concept of Python.pptx includes design tool, identifier, variables.Basic concept of Python.pptx includes design tool, identifier, variables.
Basic concept of Python.pptx includes design tool, identifier, variables.supriyasarkar38
 

Similar to UNIT 3.pptx (20)

Pythonppt28 11-18
Pythonppt28 11-18Pythonppt28 11-18
Pythonppt28 11-18
 
FUNDAMENTALS OF PYTHON LANGUAGE
 FUNDAMENTALS OF PYTHON LANGUAGE  FUNDAMENTALS OF PYTHON LANGUAGE
FUNDAMENTALS OF PYTHON LANGUAGE
 
INTERNSHIP REPORT.docx
 INTERNSHIP REPORT.docx INTERNSHIP REPORT.docx
INTERNSHIP REPORT.docx
 
python PPT Session 1.pptx
python PPT Session 1.pptxpython PPT Session 1.pptx
python PPT Session 1.pptx
 
First Steps in Python Programming
First Steps in Python ProgrammingFirst Steps in Python Programming
First Steps in Python Programming
 
Automation Testing theory notes.pptx
Automation Testing theory notes.pptxAutomation Testing theory notes.pptx
Automation Testing theory notes.pptx
 
Python4HPC.pptx
Python4HPC.pptxPython4HPC.pptx
Python4HPC.pptx
 
Python functional programming
Python functional programmingPython functional programming
Python functional programming
 
Python Basics
Python BasicsPython Basics
Python Basics
 
Fundamentals of Data Structures Unit 1.pptx
Fundamentals of Data Structures Unit 1.pptxFundamentals of Data Structures Unit 1.pptx
Fundamentals of Data Structures Unit 1.pptx
 
Basics of cpp
Basics of cppBasics of cpp
Basics of cpp
 
Introduction to programming with python
Introduction to programming with pythonIntroduction to programming with python
Introduction to programming with python
 
Software Engineering
Software EngineeringSoftware Engineering
Software Engineering
 
Python Programming | JNTUK | UNIT 1 | Lecture 5
Python Programming | JNTUK | UNIT 1 | Lecture 5Python Programming | JNTUK | UNIT 1 | Lecture 5
Python Programming | JNTUK | UNIT 1 | Lecture 5
 
modul-python-all.pptx
modul-python-all.pptxmodul-python-all.pptx
modul-python-all.pptx
 
Presentation on python
Presentation on pythonPresentation on python
Presentation on python
 
PROBLEM SOLVING TECHNIQUES USING PYTHON.pptx
PROBLEM SOLVING TECHNIQUES USING PYTHON.pptxPROBLEM SOLVING TECHNIQUES USING PYTHON.pptx
PROBLEM SOLVING TECHNIQUES USING PYTHON.pptx
 
python presntation 2.pptx
python presntation 2.pptxpython presntation 2.pptx
python presntation 2.pptx
 
علم البيانات - Data Sience
علم البيانات - Data Sience علم البيانات - Data Sience
علم البيانات - Data Sience
 
Basic concept of Python.pptx includes design tool, identifier, variables.
Basic concept of Python.pptx includes design tool, identifier, variables.Basic concept of Python.pptx includes design tool, identifier, variables.
Basic concept of Python.pptx includes design tool, identifier, variables.
 

More from KONGUNADU COLLEGE OF ENGINEERING AND TECHNOLOGY (7)

UNIT-5.pptx
UNIT-5.pptxUNIT-5.pptx
UNIT-5.pptx
 
UNIT4.pptx
UNIT4.pptxUNIT4.pptx
UNIT4.pptx
 
unit3.pptx
unit3.pptxunit3.pptx
unit3.pptx
 
UNIT 5.pptx
UNIT 5.pptxUNIT 5.pptx
UNIT 5.pptx
 
UNIT 4.pptx
UNIT 4.pptxUNIT 4.pptx
UNIT 4.pptx
 
UNIT 2.pptx
UNIT 2.pptxUNIT 2.pptx
UNIT 2.pptx
 
UNIT 1.pdf
UNIT 1.pdfUNIT 1.pdf
UNIT 1.pdf
 

Recently uploaded

Secure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech LabsSecure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech Labsamber724300
 
Comprehensive energy systems.pdf Comprehensive energy systems.pdf
Comprehensive energy systems.pdf Comprehensive energy systems.pdfComprehensive energy systems.pdf Comprehensive energy systems.pdf
Comprehensive energy systems.pdf Comprehensive energy systems.pdfalene1
 
Prach: A Feature-Rich Platform Empowering the Autism Community
Prach: A Feature-Rich Platform Empowering the Autism CommunityPrach: A Feature-Rich Platform Empowering the Autism Community
Prach: A Feature-Rich Platform Empowering the Autism Communityprachaibot
 
Theory of Machine Notes / Lecture Material .pdf
Theory of Machine Notes / Lecture Material .pdfTheory of Machine Notes / Lecture Material .pdf
Theory of Machine Notes / Lecture Material .pdfShreyas Pandit
 
March 2024 - Top 10 Read Articles in Artificial Intelligence and Applications...
March 2024 - Top 10 Read Articles in Artificial Intelligence and Applications...March 2024 - Top 10 Read Articles in Artificial Intelligence and Applications...
March 2024 - Top 10 Read Articles in Artificial Intelligence and Applications...gerogepatton
 
Immutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdfImmutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdfDrew Moseley
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating SystemRashmi Bhat
 
Cost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based questionCost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based questionSneha Padhiar
 
A brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision ProA brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision ProRay Yuan Liu
 
STATE TRANSITION DIAGRAM in psoc subject
STATE TRANSITION DIAGRAM in psoc subjectSTATE TRANSITION DIAGRAM in psoc subject
STATE TRANSITION DIAGRAM in psoc subjectGayathriM270621
 
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Sumanth A
 
Detection&Tracking - Thermal imaging object detection and tracking
Detection&Tracking - Thermal imaging object detection and trackingDetection&Tracking - Thermal imaging object detection and tracking
Detection&Tracking - Thermal imaging object detection and trackinghadarpinhas1
 
Curve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptxCurve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptxRomil Mishra
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating SystemRashmi Bhat
 
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.elesangwon
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxRomil Mishra
 
The Satellite applications in telecommunication
The Satellite applications in telecommunicationThe Satellite applications in telecommunication
The Satellite applications in telecommunicationnovrain7111
 
CS 3251 Programming in c all unit notes pdf
CS 3251 Programming in c all unit notes pdfCS 3251 Programming in c all unit notes pdf
CS 3251 Programming in c all unit notes pdfBalamuruganV28
 
TEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACHTEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACHSneha Padhiar
 

Recently uploaded (20)

Secure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech LabsSecure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech Labs
 
Comprehensive energy systems.pdf Comprehensive energy systems.pdf
Comprehensive energy systems.pdf Comprehensive energy systems.pdfComprehensive energy systems.pdf Comprehensive energy systems.pdf
Comprehensive energy systems.pdf Comprehensive energy systems.pdf
 
Prach: A Feature-Rich Platform Empowering the Autism Community
Prach: A Feature-Rich Platform Empowering the Autism CommunityPrach: A Feature-Rich Platform Empowering the Autism Community
Prach: A Feature-Rich Platform Empowering the Autism Community
 
Theory of Machine Notes / Lecture Material .pdf
Theory of Machine Notes / Lecture Material .pdfTheory of Machine Notes / Lecture Material .pdf
Theory of Machine Notes / Lecture Material .pdf
 
March 2024 - Top 10 Read Articles in Artificial Intelligence and Applications...
March 2024 - Top 10 Read Articles in Artificial Intelligence and Applications...March 2024 - Top 10 Read Articles in Artificial Intelligence and Applications...
March 2024 - Top 10 Read Articles in Artificial Intelligence and Applications...
 
Immutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdfImmutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdf
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating System
 
Cost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based questionCost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based question
 
A brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision ProA brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision Pro
 
STATE TRANSITION DIAGRAM in psoc subject
STATE TRANSITION DIAGRAM in psoc subjectSTATE TRANSITION DIAGRAM in psoc subject
STATE TRANSITION DIAGRAM in psoc subject
 
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
 
Versatile Engineering Construction Firms
Versatile Engineering Construction FirmsVersatile Engineering Construction Firms
Versatile Engineering Construction Firms
 
Detection&Tracking - Thermal imaging object detection and tracking
Detection&Tracking - Thermal imaging object detection and trackingDetection&Tracking - Thermal imaging object detection and tracking
Detection&Tracking - Thermal imaging object detection and tracking
 
Curve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptxCurve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptx
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating System
 
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptx
 
The Satellite applications in telecommunication
The Satellite applications in telecommunicationThe Satellite applications in telecommunication
The Satellite applications in telecommunication
 
CS 3251 Programming in c all unit notes pdf
CS 3251 Programming in c all unit notes pdfCS 3251 Programming in c all unit notes pdf
CS 3251 Programming in c all unit notes pdf
 
TEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACHTEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACH
 

UNIT 3.pptx

  • 1. KONGUNADU COLLEGE OF ENGINEERING AND TECHNOLOGY (AUTONOMOUS) NAMAKKAL- TRICHY MAIN ROAD, THOTTIAM DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING Mr.S.HARI KUMAR Assistant Professor / ECE KNCET 20EC503PE-INTERNET OF THINGS (REGULATION-KNCET - UGR2020) UNIT III - IoT LOGICAL DESIGN USING PYTHON
  • 2. Python Python • Python is a general-purpose, high level and object-oriented programming language. Python is an interpreted scripting language also. • Python is a case-sensitive language. This means, Variable and variable are not the same. • Multiple words can be separated using an under score, like this is_a_long_variable. • Python program can be saved it with .py extension. • Guido Van Rossum is known as the founder of Python programming. The following programming languages influence Python: • ABC language. • Modula-3
  • 3. Python Applications Python Applications • Desktop Applications • Web Applications • Data Science • Artificial Intelligence • Machine Learning • Scientific Computing • Robotics • Internet of Things (IoT) • Gaming • Mobile Apps • Data Analysis and Preprocessing
  • 4. Characteristics of Python Multi-paradigm programming language • Python supports more than one programming paradigms including object-oriented programming and structured programming Interpreted Language • Python is an interpreted language and does not require an explicit compilation step. The Python interpreter executes the program source code directly, statement by statement, as a processor or scripting engine does. Interactive Language • Python provides an interactive mode in which the user can submit commands at the Python prompt and interact with the interpreter directly. Easy-to-learn, read and maintain • Python is a minimalistic language with relatively few keywords, uses English key words and has fewer syntactical constructions as compared to other languages. Reading Python programs feels like English with pseudo-code like constructs. Python is easy to learn yet an extremely powerful language for a wide range of applications.
  • 5. Characteristics of Python Object and Procedure Oriented • Python supports both procedure-oriented programming and object-oriented programming. Procedure oriented paradigm allows programs to be written around procedures or functions that allow reuse of code. Procedure oriented paradigm allows programs to be written around objects that include both data and functionality. Extendable • Python is an extendable language and allows integration of low-level modules written in languages such as C/C++. This is useful when you want to speed up a critical portion of a program. Scalable • Due to the minimalistic nature of Python, it provides a manageable structure for large programs. Portable • Since Python is an interpreted language, programmers do not have to worry about compilation, linking and loading of programs. Python programs can be directly executed from source.
  • 6. Python Operators Python Operators • Arithmetic operators • Comparison operators • Assignment Operators • Logical Operators • Bitwise Operators • Membership Operators • Identity Operators
  • 7. Arithmetic operators Operator Meaning Example + Add two operands or unary plus x + y+ 2 - Subtract right operand from the left or unary minus x - y- 2 * Multiply two operands x * y / Divide left operand by the right one (always results into float) x / y % Modulus - remainder of the division of left operand by the right x % y (remainder of x/y) // Floor division - division that results into whole number adjusted to the left in the number line x // y ** Exponent - left operand raised to the power of right x**y (x to the power y)
  • 8. Arithmetic operators Example x = 15 y = 4 print('x + y =',x+y) print('x - y =',x-y) print('x * y =',x*y) print('x / y =',x/y) print('x // y =',x//y) print('x ** y =',x**y) Output: x + y = 19 x - y = 11 x * y = 60 x / y = 3.75 x // y = 3 x ** y = 50625
  • 9. Comparison operators Operator Meaning Example > Greater than - True if left operand is greater than the right x > y < Less than - True if left operand is less than the right x < y == Equal to - True if both operands are equal x == y != Not equal to - True if operands are not equal x != y >= Greater than or equal to - True if left operand is greater than or equal to the right x >= y <= Less than or equal to - True if left operand is less than or equal to the right x <= y
  • 10. Comparison operators Example x = 10 y = 12 print('x > y is',x>y) print('x < y is',x<y) print('x == y is',x==y) print('x != y is',x!=y) print('x >= y is',x>=y) print('x <= y is',x<=y) Output: x > y is False x < y is True x == y is False x != y is True x >= y is False x <= y is True
  • 11. Logical operators Operator Meaning Example and True if both the operands are true x and y or True if either of the operands is true x or y not True if operand is false (complements the operand) not x
  • 12. Logical operators Example x = True y = False print('x and y is',x and y) print('x or y is',x or y) print('not x is',not x) Output: x and y is False x or y is True not x is False