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

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