In this lesson, I learned about booleans, and how they could be used for rational or logical operations. Like for comparing strings or numbers.
#1
a = True
b = False
if a:
print("a is true")
else:
print("a is false")
if b:
print("b is true")
else:
print("b is false")
#2
num = int(input("Please enter a number: "))
if num > 10:
print(num, "is greater than 10")
elif num < 10:
print(num, "is less than 1")
else:
print("Not a number")
#3
num = int(input("please enter a three digit number: "))
if num >= 100 and num <= 999:
print(num, "is three digits")
else:
print(num, "is not three digits")
#Python
list = [True, False]
print("A B Result")
for i in list:
for j in list:
print(i, j, i and j)