Skip to content

Commit 9f4c51d

Browse files
committed
comparison operators implemented
1 parent 46ea47f commit 9f4c51d

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

027_comparison.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ def a_is_equal_to_b(a, b):
3939

4040
def a_is_less_than_b(a, b):
4141
# Uncomment this next line and replace ?? with the right operator
42-
# return a ?? b
43-
pass
42+
return a < b
43+
4444

4545
check_that_these_are_equal(
4646
a_is_less_than_b(1, 2),
@@ -63,8 +63,8 @@ def a_is_less_than_b(a, b):
6363
print("Function: a_is_greater_than_b")
6464

6565
def a_is_greater_than_b(a, b):
66-
# return a ?? b
67-
pass
66+
return a > b
67+
6868

6969
check_that_these_are_equal(
7070
a_is_greater_than_b(1, 2),
@@ -87,8 +87,8 @@ def a_is_greater_than_b(a, b):
8787
print("Function: a_is_less_than_or_equal_to_b")
8888

8989
def a_is_less_than_or_equal_to_b(a, b):
90-
# return a ?? b
91-
pass
90+
return a <= b
91+
9292

9393
check_that_these_are_equal(
9494
a_is_less_than_or_equal_to_b(1, 2),
@@ -111,8 +111,8 @@ def a_is_less_than_or_equal_to_b(a, b):
111111
print("Function: a_is_greater_than_or_equal_to_b")
112112

113113
def a_is_greater_than_or_equal_to_b(a, b):
114-
# return a ?? b
115-
pass
114+
return a >= b
115+
116116

117117
check_that_these_are_equal(
118118
a_is_greater_than_or_equal_to_b(1, 2),
@@ -135,8 +135,8 @@ def a_is_greater_than_or_equal_to_b(a, b):
135135
print("Function: a_is_not_equal_to_b")
136136

137137
def a_is_not_equal_to_b(a, b):
138-
# return a ?? b
139-
pass
138+
return a != b
139+
140140

141141
check_that_these_are_equal(
142142
a_is_not_equal_to_b(1, 2),
@@ -161,8 +161,8 @@ def a_is_not_equal_to_b(a, b):
161161
# May be a little tricky — search for
162162
# "python check if string contains substring"
163163
def a_is_within_b(a, b):
164-
# return a ?? b
165-
pass
164+
return a in b
165+
166166

167167
check_that_these_are_equal(
168168
a_is_within_b("e", "hello"),

0 commit comments

Comments
 (0)