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 #287 background imageLoading...
Page #287 background image
SunFounder ESP32 Starter Kit
#print("Can't run it")
print("hello world") #This is a annotationhello world
>>> %Run -c $EDITOR_CONTENT
hello world
Multi-line comment
If you want to comment on multiple lines, you can use multiple # signs.
#This is a comment
#written in
#more than just one line
print("Hello, World!")
>>> %Run -c $EDITOR_CONTENT
Hello, World!
Or, you can use multi-line strings instead of expected.
Since MicroPython ignores string literals that are not assigned to variables, you can add multiple lines of strings (triple
quotes) to the code and put comments in them:
"""
This is a comment
written in
more than just one line
"""
print("Hello, World!")
>>> %Run -c $EDITOR_CONTENT
Hello, World!
As long as the string is not assigned to a variable, MicroPython will ignore it after reading the code and treat it as if
you made a multi-line comment.
3.6.3 Print()
The print() function prints the specified message to the screen, or other standard output device. The message can be
a string, or any other object, the object will be converted into a string before written to the screen.
Print multiple objects:
print("Welcome!", "Enjoy yourself!")
>>> %Run -c $EDITOR_CONTENT
Welcome! Enjoy yourself!
Print tuples:
x = ("pear", "apple", "grape")
print(x)
3.6. 1.6 (Optional) MicroPython Basic Syntax 281

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