๐Python Guide
Understanding Python's basics
Last updated
Was this helpful?
Understanding Python's basics
print (โmessageโ)This will display whatever you put in the place of message in the Rapid Router Output console. You should surround your message with single quotes.
var_1 = โHello!โ
var_2 = var_1
n = 1You can create your own variables using any name except those on the reserved list below. You can assign values to variables using the โ=โ operator. You can assign the value of one variable to another variable.
You can use the variables anywhere in your program that you would normally use whatever the variable stands for.
n = 2 + 3
n = 2 โ 3
n = 2 * 3
n = 2 / 3You can use these with numbers or numeric variables or both.
The examples show addition, subtraction, multiplication and division.
With division, note that the result will be rounded down. For example, the following: n = 5 / 2
The value of n will be 2, not 2.5.
Instead of waiting until condition is no longer True, the break statement will stop executing the loop immediately.
Instead of executing the rest of the commands in the loop, this statement will immediately move onto the next time around the loop.
This statement does absolutely nothing. This is required if you want to define a procedure (or another block such as for or while) that has no other commands.
Reserved words are words that cannot be used as variable or procedure names as they are 'reserved' by Python:
Last updated
Was this helpful?
Was this helpful?
while condition:
breakfor count in range(5):
continuepassand
asset
break
class
continue
def
del
elif
else
except
exec
finally
for
from
global
if
import
in
is
not
or
pass
print
raise
return
try
while
with