Data Engineering Lab

if Statements & Single Conditions — Python practice

Q1: Meet the if statement — print only when a condition is True

An if statement runs its indented block ONLY when the condition is True. When False, Python skips that block silently. Master the syntax: if : (colon required) then indented body.

Requirements

  • row_value = 7
  • Print "Valid" only when row_value is positive (greater than 0)
  • No else needed — nothing should print for a negative value
  • Output: Valid

Enable JavaScript to edit code, run the exercise, and review feedback. Your saved work loads in the existing practice workspace.