Previous Lecture | Lec 5 | Next Lecture |
Lec 5, Mon 01/20
- Truth Tables:
- T and T -> T
- T and F -> F
-
F and F -> F
- T or T -> T
- T or F -> T
- F or F -> F
- What is the result of the comparison?
'nature' > 'nurture'
- Answer: False because ‘a’ is less than ‘u’ since it comes first in the alphabet
'week' > 'weekend'
- Answer: False
raining = False
sunny == True
weekend = True
if raining == True:
print("bring an umbrella")
elif sunny == True:
print("remember your skateboard")
if weekend == True:
print("Let's go swimming")
else
print("Study outside")
print("Have a great day!")
Output:
“Wear sunscreen!” “Let’s go swimming” “Have a great day!”