Logical Operators
123456is_adult = True has_license = True if is_adult: if has_license: print("You can drive car")
Previously, we explored situations involving a single condition in the if statement. Now, let's delve into scenarios where we need to evaluate multiple conditions.
One approach is to use nested if statements, as demonstrated in the example:
Example 1:
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 1. Kapittel 3
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår
Fantastisk!
Completion rate forbedret til 33.33
Logical Operators
Sveip for å vise menyen
123456is_adult = True has_license = True if is_adult: if has_license: print("You can drive car")
Previously, we explored situations involving a single condition in the if statement. Now, let's delve into scenarios where we need to evaluate multiple conditions.
One approach is to use nested if statements, as demonstrated in the example:
Example 1:
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 1. Kapittel 3