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.

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> ...

Django Views & URLs (Complete Guide Telugu)

Introduction Previous article lo manam Django project create chesam. Ipudu chuddam πŸ‘‰ user request vachinappudu Django ela respond avthundi? Django lo Views & URLs anevi chala important concepts πŸ”₯ 🧠 Simple ga ardham: πŸ‘‰ URL = address πŸ‘‰ View = action (logic) User URL enter chesthe → View execute avthundi πŸ”— URLs ante enti? Example: http://127.0.0.1:8000/about/ http://127.0.0.1:8000/contact/ πŸ‘‰ /about/ , /contact/ ni URLs antaru Django lo ee URLs ni urls.py file lo define chestam ⚙️ urls.py Example from django.urls import path from . import views urlpatterns = [ path('about/', views.about_view), ] πŸ‘‰ Ikkada: 'about/' → URL about_view → View function ⚡ Views ante enti? πŸ‘‰ View ante Python function User request vachinappudu: πŸ‘‰ View function run avthundi πŸ‘‰ Response return chestundi πŸ’» Simple View Example from django.http import HttpResponse def about_view(request): return HttpResponse("Hello from About Page") πŸ‘‰ Browser lo /about/ open ches...