Dev4Hub
TutorialsRoadmapReviewNotesCode Editor
Sign inSign up
  • Python
  • HTML
  • CSS
  • JavaScript
  • SQL
Your progress0 / 10
search
school

Python Basics

  • 1Python Introduction
  • 2Python Syntax
  • 3Python Variables
alt_route

Python Control Flow

  • 1Python If...Else
  • 2Python While Loops
  • 3Python For Loops
  • 4Python Functions
Tutorialschevron_rightPython Tutorialchevron_rightPython If...Else

Python If...Else

format_list_numberedLesson 8 of 11schedule1 min readview_agenda1 sectionauto_awesomeAI tutor ready
01

Conditional Statements

Python supports the usual logical conditions from mathematics. These can be used in if statements and loops.

Example

a = 33
b = 200
if b > a:
    print("b is greater than a")

Output

b is greater than a
Try it Yourself »
arrow_back PreviousPython BooleansNext arrow_forwardPython While Loops

Dev4Hub

Learn coding with hands-on tutorials, examples and quizzes — covering Python, HTML, CSS, JavaScript, SQL and more.

Tutorials

  • Python
  • HTML
  • CSS
  • JavaScript
  • SQL

Tools

  • Code Editor
  • All Tutorials
© 2026 Dev4Hub. Inspired by the W3Schools learning model.