π§ Introduction
π Python Day 2 – Variables & Data Types
Ninna manam Python install chesi first program run chesam.
Eroju manam Variables & Data Types nerchukundam.
π Variables ante data ni store cheyadaniki use chestam
π Data Types ante aa data type enti ani chepthayi
π‘ Simple ga:
Variable = box π¦
Value = danilo unna item
Example:
box lo apple unte → variable lo value untundi π
π¦ Variables in Python
π Variable create cheyadam easy:
name = "Manju"
age = 21
π Rules:
- Letters tho start avvali
- Numbers start lo undakudadhu ❌
- Spaces undakudadhu ❌
- Underscore (_) use cheyachu ✅
π§ͺ Example
name = "Manju"
age = 21
is_student = True
print(name)
print(age)
print(is_student)
π Output:
Manju
21
True
π’ Data Types in Python
1️⃣ String (str)
π Text data
name = "Manju"
2️⃣ Integer (int)
π Whole numbers
age = 21
3️⃣ Float (float)
π Decimal numbers
price = 99.99
4️⃣ Boolean (bool)
π True / False
is_active = True
π Type Check cheyadam
print(type(name))
print(type(age))
π Output:
<class 'str'>
<class 'int'>
π Type Conversion
age = "21"
age = int(age)
print(age)
π― Mini Practice
name = "YourName"
age = 20
course = "Python"
print("Name:", name)
print("Age:", age)
print("Course:", course)
π Summary
✔ Variables create cheyadam nerchukunnam
✔ Different data types chusam
✔ Type check & conversion chesam
Comments
Post a Comment