Course Content
Getting Started With Python
0/2
sdfsdfs
sdfsdfsdf
0/1
Variable and Data Types
0/1
Certificate
0/1
quiz cert
0/1
Python Programming For Beginners

Variables in Python

A variable is a container used to store data values. In Python, you don’t need to declare the type of a variable, it is automatically assigned.

Example:

name = "Aman"
age = 20
height = 5.8

print(name)
print(age)
print(height)

Rules for naming variables:

    • Must start with a letter or underscore ( _ )

    • Cannot start with a number

    • Cannot use keywords (like if, for, while) # will learn about keywords in upcoming topics

    • Case-sensitive (Name and name are different)

x = 5
5x = 7 # wrong
x5 = 8
_g = 9