Using True and False in variables
x = True
y = False
if x:
print("X is True")
else:
print("X is False")
if y:
print("Y is True")
else:
print("Y is False")
# X is True
# Y is False
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
x = True
y = False
if x:
print("X is True")
else:
print("X is False")
if y:
print("Y is True")
else:
print("Y is False")
# X is True
# Y is False