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 #309 background imageLoading...
Page #309 background image
SunFounder ESP32 Starter Kit
a = ["hello", "welcome"]
b = ["hello", "welcome"]
c = a
print(a is c)
# returns True because z is the same object as x
print(a is b)
# returns False because x is not the same object as y, even if they have the same content
print(a == b)
# returns True because x is equal to y
>>> %Run -c $EDITOR_CONTENT
True
False
True
>>>
Membership Operators
Membership operators are used to test if a sequence is presented in an object.
Operator Description
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
a = ["hello", "welcome", "Goodmorning"]
print("welcome" in a)
>>> %Run -c $EDITOR_CONTENT
True
>>>
Bitwise Operators
Bitwise operators are used to compare (binary) numbers.
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
3.6. 1.6 (Optional) MicroPython Basic Syntax 303

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