Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons

© 2026 BraveProgrammer. All rights reserved.

  1. Courses
  2. /
  3. Python Fundamentals

Lesson 5 of 55 · Python

Basic Operators

Duration: 20 minutes

Basic Operators\n\nPython provides a rich set of operators for arithmetic, comparison, logical, and assignment operations.\n\n## Arithmetic Operators\npython\na = 10\nb = 3\nprint('Add:', a + b) # 13\nprint('Sub:', a - b) # 7\nprint('Mul:', a * b) # 30\nprint('Div:', a / b) # 3.333...\nprint('Floor div:', a // b) # 3\nprint('Mod:', a % b) # 1\nprint('Power:', a ** b) # 1000\n\n\n## Comparison Operators\npython\nprint('a > b:', a > b) # True\nprint('a == b:', a == b) # False\n\n\n## Logical Operators\npython\nprint('a > 5 and b < 5:', a > 5 and b < 5) # True\nprint('a > 5 or b > 5:', a > 5 or b > 5) # True\nprint('not (a == b):', not (a == b)) # True\n\n\nThese operators let you build expressions that drive control‑flow and calculations.\n

Previous: Variables and Data TypesNext: Control Flow – If Statements