Skip to main content

🐍 Python Day 2 – Variables & Data Types


 

🧠 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

Popular posts from this blog

Django ante enti? (Beginner Friendly Telugu Guide)

  Introduction Meeru web development start cheyyali anukuntunnara? Leka backend development nerchukovali anukuntunnara? Appudu meeru tappakunda vinnadi oka peru πŸ‘‰ Django Ee article lo manam simple ga, clear ga ardham ayyela chuddam — Django ante enti, enduku use chestaru, ela start cheyyali.

Python Day 5 – If Else Conditions

  🐍 Python Day 5 – If Else Conditions 🧠 Introduction 🐍 Python Day 5 – If Else Conditions Ippati varaku manam operators nerchukunnam. I roju manam decision making (If-Else) nerchukundam. πŸ‘‰ Program lo condition base chesi decisions tiskovadaniki use avutundi πŸ’‘ Example: Age 18 kanna ekkuva unte → eligible Lekapothe → not eligible πŸ”Ή Basic If Condition age = 20 if age > 18 : print ( "Eligible" ) πŸ”Ή If-Else Condition age = 16 if age >= 18 : print ( "Eligible" ) else : print ( "Not Eligible" ) πŸ”Ή If-Elif-Else marks = 75 if marks >= 90 : print ( "Grade A" ) elif marks >= 60 : print ( "Grade B" ) else : print ( "Grade C" ) πŸ§ͺ Real Example (User Input) age = int ( input ( "Enter your age: " )) if age >= 18 : print ( "You can vote ✅" ) else : print ( "You cannot vote ❌" ) ⚠️ Important Points πŸ‘‰ Indentation (space) very import...

Django Templates & HTML Rendering (Complete Guide Telugu)

  Introduction Previous article lo manam Views & URLs chusam. Ipudu next important concept πŸ‘‰ Templates & HTML Rendering Django lo dynamic HTML pages ela create cheyyalo ee article lo nerchukundam πŸ”₯ 🧠 Templates ante enti? πŸ‘‰ Template ante HTML file "T emplate ante HTML file matrame kaadu, Django lo dynamic content ni display cheyadaniki use chestam. Example ga, database lo unna blog posts ni HTML page lo chupinchadaniki templates use avutayi. " But special enti ante: πŸ‘‰ Dynamic data display cheyyachu (Python data → HTML lo show) πŸ“ Templates folder create cheyyadam Mee app lo templates ane folder create cheyandi: myapp/ templates/ index.html ⚙️ settings.py lo config cheyyali settings.py open cheyandi: TEMPLATES = [ { 'DIRS': [], ... }, ] πŸ‘‰ Usually app templates automatic ga detect chestundi πŸ’» Simple HTML Template index.html : <!DOCTYPE html> <html> <head> <title>Django Page</title> ...