How definition and declaration of variable happens in Python?

I want to understand the concept of variable declaration and definition in Python.

There are no variable declarations in Python.

x = 1

defines a variable “x” and sets its value to 1.

Have you tried going through the tutorial?

https://docs.python.org/3/tutorial/index.html

1 Like

Define variable. Are you asking about simple built-in types or custom classes?

Thanks for explaining :slight_smile: