-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy pathgreater-and-less-than.py
More file actions
31 lines (25 loc) · 866 Bytes
/
greater-and-less-than.py
File metadata and controls
31 lines (25 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
'''
Greater and less than
100xp
In the video, Filip also talked about the less than and greater than signs, < and > in Python.
You can combine them with an equals sign: <= and >=. Pay attention: <= is valid syntax,
but =< is not.
All Python expressions in the following code chunk evaluate to True:
3 < 4
3 <= 4
"alpha" <= "beta"
Remember that for string comparison, Python determines the relationship based on alphabetical order.
Instructions
-Write Python expressions, wrapped in a print() function, to check whether:
-x is greater than or equal to -10. x has already been defined for you.
-"test" is less than or equal to y. y has already been defined for you.
-True is greater than False.
'''
# Comparison of integers
x = -3 * 6
print(x >= -10)
# Comparison of strings
y = "test"
print('test' <= y)
# Comparison of booleans
print(True > False)