Skip to content
Variables on python
Profile icon
AlfiePython

How do I create a variable with python code so I can do things like

A = 5
print ("A")

which the result is 5

You are viewing a single comment. View All
Answered by MocaCDeveloper [earned 5 cycles]
View Answer
Profile icon
elburg

@MocaCDeveloper
also, these commands are helpful:

image

However, if a variable is created inside a function, it will only be used inside that function and can never be called anywhere else besides the function itself. if the variable is created on the outside, it can be used with the entire program, but only in the file that it was created in.