July 2018
Beginner
202 pages
5h 42m
English
How can you tell what the value of a variable is? One way is to print the value out to the console. To print the value of a variable, you first type the keyword print, then the name of the variable between parentheses (). The full syntax is:
print (<variable>)
For example, we can check the value assigned to foo with the following code:
foo = "bar"print (foo)
The first line of code creates a variable named foo and assigns it the string value "bar". The second line prints the value of the foo variable. This means bar will be printed to the console:
