- 1Problem
Kommt Momo ins Haus?
FrageFall 1ifSchlüssel dabei?mit Schlüssel
?
✓ geht ins HausFall 2elseohne Schlüssel
✗ schläft vor der Tür
Momo steht vor ihrer Haustür. Manchmal hat sie den Schlüssel dabei, manchmal nicht. Was passiert in beiden Fällen?
1if Momo hat den Schlüssel:
2Momo geht ins Haus
3else:
4Momo schläft vor der Tür
1hat_schluessel = True
2if hat_schluessel:
3print("Momo geht ins Haus")
4else:
5print("Momo schläft vor der Tür")