How do I use (call) a variable in Python?

1) You must have invoked any variables you wish to use.

image template.PNG

2) There are many different ways to "call" or use a variable. First look at the variable called story, it contains a story.

image template.PNG

3) The variable is invoked, we now can do so many things with it. Lets print the story onto our screen.

image template.PNG

4) To use or "call" the variable we must simple give the variable something to do. In this case if we write print() here we can make the variable print out.

image template.PNG

5) We do NOT need to write the story over, that is inside the variable. So all we need to do is put the variable name in the print statement as pictured.

image template.PNG

6) When we hit run, you can see on the right hand side that the story has printed out!

image template.PNG

7) If I add another variable and also call it, It will add more!

image template.PNG

8) Lets look at another example. I have 2 variables, number 1 and number 2.

image template.PNG

9) If we simple use another print statement and then add the variable NAMES in the parenthesis, look at what happens.

image template.PNG

10) We can add variables by name instead of numbers!

image template.PNG