You can put if statements inside other if statements:
if has_ticket:
if age >= 18:
print("Welcome to the show")
else:
print("Need adult supervision")
else:
print("Buy a ticket first")
Each level adds more indentation. The inner if only runs if the outer if condition is True.
Nesting is useful when you have hierarchical conditions. But too much nesting makes code hard to read. If you're nesting more than - levels deep, consider refactoring with and/or or separate functions.