Python If Statement
Python’s if statement is used to execute a block of code only when a specific condition evaluates to True.
Syntax
# Generic version of an if statementif condition: # Code to execute if the condition is True passExample
# Concrete example of an if statementage = 18
if age >= 18: print("You are eligible to vote.")# Output: You are eligible to vote.