Tag Archives: variables

Variables

Variables in Python can hold text and numbers. For example:

The variable names are on the left and the values on the right. Once a variable is assigned, it can be used in other places of the program. Related Course: In the example above, we have three variables: x, price and word. Note: Variables […]

Global variables

What is the difference between global and local variables? A global variable can be accessed anywhere in code. A local variable can only be used in a specific code block. Related course: global variable example We say the scope is global, it can be used in any function or location throughout the code. In the […]