DEV Community

hebaShakeel
hebaShakeel

Posted on

Variables in Python

Declaring a variable

name = "Omair"
print(name)

To create a variable, there is no need to declare it in Python. It can be created at the time of use. There is also no need to specify the data type of the variable while creating it. This is called Dynamic Typing.

Static Typing refers to specifying the data type of the variable when declaring them.

name = 4
print(name)

In Python, a variable is not bound to any datatype. This feature is called as Dynamic Binding.

Special Syntax

To declare multiple variables in a single line

a = 5; b= 3; c = 5
a, b, c = 2, 3, 4
a = b = c = 6

Top comments (1)

Collapse
 
sajjadrahman56 profile image
Sajjad Rahman

hey @hebashakeel
at first warmly welcome to the community . keep up your job .

i am also beginner , few suggestions for you to motivate you
you can add picture or code snippet to looks good the content .