EasyManuals Logo

SunFounder ESP32 User Manual

Default Icon
771 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #308 background imageLoading...
Page #308 background image
SunFounder ESP32 Starter Kit
Comparison Operators
Comparison operators are used to compare two values.
Operator Name
== Equal
!= Not equal
< Less than
> Greater than
>= Greater than or equal to
<= Less than or equal to
a = 6
b = 8
print(a>b)
>>> %Run test.py
False
>>>
Return False, beause the a is less than the b.
Logical Operators
Logical operators are used to combine conditional statements.
Operator Description
and Returns True if both statements are true
or Returns True if one of the statements is true
not Reverse the result, returns False if the result is true
a = 6
print(a > 2 and a < 8)
>>> %Run -c $EDITOR_CONTENT
True
>>>
Identity Operators
Identity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with
the same memory location.
Operator Description
is Returns True if both variables are the same object
is not Returns True if both variables are not the same object
302 Chapter 3. For MicroPython User

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the SunFounder ESP32 and is the answer not in the manual?

SunFounder ESP32 Specifications

General IconGeneral
BrandSunFounder
ModelESP32
CategoryController
LanguageEnglish