Lesson 1, Topic 3
In Progress

Creating variables in Python

John 23/11/2024
Lesson Progress
0% Complete

Variables hold values. In Python, variables do not require forward declaration – all you need to do is provide a variable name and assign it some value.

The Python interpreter shows you a prompt that looks like this: >>>. Each line you type into the interpreter is taken one at a time, parsed by the interpreter, and if the line is complete, executed as well.

If you enter one = 1 in the Python interpreter and hit “Enter”, the interpreter will just show you a new line prompt.

Example

x = 5
y = "John"
print(x)
print(y)
Social Community We would like to show you notifications for the latest news and updates.
Dismiss
Allow Notifications