File tree Expand file tree Collapse file tree
content/booleans-and-conditionals/reading/logical-operators Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -108,8 +108,16 @@ to be true for the overall result to be `True`.
108108Let's look at another code example. Change the value of ` num ` to see when
109109each combined expression returns ` True ` .
110110
111- Using ` num = 5 ` , lines 2 and 4 both return ` True ` because at least one of
112- the two comparisons is ` True ` . Line 6 returns ` False ` because both of the
111+ ``` python {linenos=tabel}
112+ num = 5
113+
114+ print (num > 0 or num < 10 )
115+ print (7 > num or num == 3 )
116+ print (num* 5 > 100 or ' dog' == ' cat' )
117+ ```
118+
119+ Using ` num = 5 ` , lines 3 and 4 both return ` True ` because at least one of
120+ the two comparisons is ` True ` . Line 5 returns ` False ` because both of the
113121comparisons are ` False ` .
114122
115123{{% notice green Tip %}}
@@ -221,4 +229,4 @@ Predict if each of the following expressions evaluates to `True` or
221229
222230{{% /notice %}}
223231
224- <!-- True, False, False, True -->
232+ <!-- True, False, False, True -->
You can’t perform that action at this time.
0 commit comments