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

“Password Reset in Django – Complete Guide”

  Password Reset in Django – Complete Guide πŸ” Introduction Web applications lo Password Reset feature chala important. User password marchipothe, easy ga recover chesukovadaniki use avutundi. Real-time lo: Gmail Facebook Instagram anni password reset system use chestayi. ⚙️ How Password Reset Works? πŸ‘‰ Step-by-step flow: User “Forgot Password” click chestadu Email enter chestadu System reset link send chestundi User link open chestadu New password set chestadu πŸ‘‰ Idi secure ga untundi because: Token based verification Time limit untundi ⚙️ Django Password Reset Code 1️⃣ settings.py (EMAIL Setup) # settings.py EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' πŸ‘‰ Dev lo console lo email link chupistundi πŸ‘‰ Production lo Gmail SMTP use cheyachu 2️⃣ urls.py from django . urls import path from django . contrib . auth import views as auth_views urlpatterns = [ path ( 'password-reset/' , auth_v...

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

Python Day 8 – Lists

  🧠 Introduction 🐍 Python Day 8 – Lists Ippati varaku manam functions nerchukunnam. Eroju manam Lists gurinchi nerchukundam. πŸ‘‰ List ante multiple values ni okesari store cheyadaniki use avutundi πŸ’‘ Example: Shopping items list laga πŸ“¦ πŸ”Ή Create List numbers = [ 1 , 2 , 3 , 4 , 5 ] names = [ "Manju" , "Ravi" , "Kiran" ] πŸ”Ή Access List (Index) print ( numbers [ 0 ]) # 1 print ( names [ 1 ]) # Ravi πŸ‘‰ Index always 0 nundi start avutundi ⚠️ πŸ”Ή Add Elements numbers . append( 6 ) print ( numbers ) πŸ”Ή Remove Elements numbers . remove( 3 ) print ( numbers ) πŸ”Ή Loop Through List for i in numbers : print ( i ) πŸ”Ή List Length print ( len ( numbers )) πŸ”Ή Slicing print ( numbers [ 1 : 4 ]) πŸ§ͺ Real Example marks = [ 80 , 90 , 75 , 60 ] for m in marks : if m >= 75 : print ( "Pass:" , m ) 🎯 Mini Practice names = [ "A" , "B" , "C" ] names . append( "D...