TGViewer
Data Science & Machine Learning Data Science & Machine Learning @datasciencefun · 77.8K subscribers
Post #4045 5.26K
Now, let's move to the next topic of Data Science Roadmap

✅ Python Operators

🐍⚡ Operators help perform operations on variables and values.

🔹 1. Arithmetic Operators (Math Operations)

Used for calculations.
- Addition (5 + 2 = 7)
- Subtraction (5 - 2 = 3)
- Multiplication (5 * 2 = 10)
- Division (5 / 2 = 2.5)
- % Modulus (remainder) (5 % 2 = 1)
- Power (2 3 = 8)
- // Floor division (5 // 2 = 2)

✅ Example:
a = 10
b = 3
print(a + b)
print(a % b)
print(a ** b)


🔹 2. Comparison Operators (Return True/False)

Used for decision making.

- == Equal
- != Not equal
- > Greater than
- < Less than
- >= Greater or equal
- <= Less or equal

✅ Example:
x = 5
print(x > 3)  # True
print(x == 5)  # True


🔹 3. Logical Operators

Used to combine conditions.

- and: Both conditions true
- or: At least one true
- not: Reverse result

✅ Example:
age = 20
print(age > 18 and age < 30)


🔹 4. Assignment Operators

Used to assign values.
x = 5
x += 2  # x = x + 2
x -= 1
x *= 3


🔹 5. Practice (Must Try)
a = 15
b = 4
print(a + b)
print(a > b)
print(a % b)
print(a < 20 and b < 10)


🎯 Today’s Goal
✅ Learn arithmetic operations
✅ Understand comparisons (True/False)
✅ Use logical conditions

Double Tap ♥️ For More
  • ❤ 16
More from @datasciencefun
  1. Oct 17, 2026Aggregate functions such as COUNT() generally cannot be used in WHERE. ✅ Correct: SELECT d…
  2. Oct 17, 2026🚀 Data Science Roadmap 2026 📍 Phase 3: SQL for Data Science 📖 Topic 7 — HAVING HAVING i…
  3. Oct 17, 2026𝗜𝗕𝗠 𝗙𝗥𝗘𝗘 𝗧𝗘𝗖𝗛 𝗖𝗢𝗨𝗥𝗦𝗘𝗦 𝟮𝟬𝟮𝟲! 🎓 Explore IBM Cognitive Class and build…
  4. Oct 16, 2026𝗗𝗮𝘁𝗮 𝘀𝗰𝗶𝗲𝗻𝗰𝗲 𝗖𝗲𝗿𝘁𝗶𝗳𝗶𝗰𝗮𝘁𝗶𝗼𝗻 𝗪𝗶𝘁𝗵 𝗔𝗜😍 Future Ready Data Scien…
  5. Oct 15, 2026Post #4665
  6. Oct 15, 2026Post #4664
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →