
In Python, you don’t need to declare the type of a variable. Just assign a value using the = sign:
name = "Alice"
age = 25
height = 5.7
name stores a string ("Alice")age stores an integer (25)height stores a floating‑point number (5.7)_)Name and name are different)student_name instead of sn)Once a variable is created, you can use it in your program:
name = "Alice"
age = 25
print("My name is", name)
print("I am", age, "years old")
Output:
My name is Alice
I am 25 years old
You can change the value stored in a variable:
age = 25
age = age + 1
print("Next year I will be", age)
Output:
Next year I will be 26
Python allows assigning values to multiple variables in one line:
x, y, z = 10, 20, 30
print(x, y, z)
Output:
10 20 30
Fill out the Get Help form and our team will contact you.
We accept UPI, Debit/Credit Cards, and Net Banking.
Yes, installment options are available for selected courses.
Yes, we provide resume and interview support.