Skip to main content

Python Day 4 – Operators

 


🐍 Python Day 4 – Operators

🧠 Introduction

🐍 Python Day 4 – Operators

Ippati varaku manam input & output nerchukunnam.
I roju manam Operators gurinchi nerchukundam.

👉 Operators ante values mida operations cheyadaniki use avuthayi
Example: +, -, *, /

💡 Maths lo use chese symbols laga ne untayi


➕ Arithmetic Operators

<> Python

a = 10
b = 5

print(a + b)
print(a - b)
print(a * b)
print(a / b)

# 15
# 5
# 50
# 2.0




🔢 More Operators

print(a % b) # Modulus (remainder)
print(a ** b) # Power
print(a // b) # Floor division


🧪 Example Program

a = int(input("Enter first number: "))
b = int(input("Enter second number: "))

print("Addition:", a + b)
print("Subtraction:", a - b)
print("Multiplication:", a * b)
print("Division:", a / b)

📌 Comparison Operators

a = 10
b = 5

print(a > b) # True
print(a < b) # False
print(a == b) # False

📌 Logical Operators

x = True
y = False

print(x and y) # False
print(x or y) # True
print(not x) # False

🎯 Mini Practice

num = int(input("Enter number: "))

print(num * 2)
print(num ** 2)

📌 Summary

✔ Arithmetic operators nerchukunnam
✔ Comparison & logical operators chusam
✔ Real-time example run 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...