# [ ] review and run code to see if 3 greater than 5
3 > 5
# [ ] review and run code to see if 3 less than or equal to 5
3 <= 5
# [ ] review and run code
# assign x equal to 3
x = 3
# test if x is equal to
x == 9
# [ ] review and run code
x = 3
print("x not equal 9 is", x != 9)
print("x equal 3 is", x == 3)
x not equal 9 is True
x equal 3 is True
X = 9 + 4
# [ ] create a test to print() True or False for x is equal to 13
print(X==13)
True
# [ ] create a test to print True or False for 3 + 3 is greater than 2 + 4
print(3+3>2+4)
False
# review code and run cell
x = 21
if x > 25:
print("x is already bigger than 25")
else:
print("x was", x)
x = 25
print("now x is", x)
x was 21
now x is 25
# review code and run cell
x = 18
if x + 18 == x + x:
print("Pass: x + 18 is equal to", x + x)
else:
print("Fail: x + 18 is not equal to", x + x)
Pass: x + 18 is equal to 36
# review code and run cell. "!" means "not"
x = 18
test_value = 18
if x != test_value:
print('x is not', test_value)
else:
print('x is', test_value)
x is 18
# review code and run cell
# DON'T ASSIGN (x = 2) when you mean to COMPARE (x == 2)
x = 2
if x = 2:
print('"==" tests for, is equal to')
else:
pass
SyntaxError: invalid syntax (2165412095.py, line 5)
# [ ] create an if/else statement that tests if y is greater than or equal x + x
# [ ] print output: "y greater than or equal x + x is" True/False ...or a similar output
x = 3
y = x + 8
if y>=x+x:
print("It is",y>=x+x,"y is greater than or equal to x+x")
else:
print("It is",y>=x+x,"y is greater than or equal to x+x")
It is True y is greater than or equal to x+x