The Control Structures tab of the Conversational Notebook offers users a convenient way to control the flow of robot programs using conditional statements like “If/Else” and loops.
If/Then/Else
The if..else
statement evaluates a test expression and will execute a a part of the program only when the test condition is True
. If the condition is False
, the body of else
is executed.
More information on “if/else” statement in Python can be found here: https://www.learnpython.org/en/Conditions
The expression to be evaluated may be entered by the user in the text box.
Loop
A loop is a programming structure that repeats a sequence of instruction until a specific condition is met. For more information on loops in Python, refer to https://www.learnpython.org/en/Loops
Users may program “while” loops or “for” loops from the conversational Loop tab. When programming a “while” loop, enter the expression to be evaluated into the text box.
Add Comment