Difference between revisions of "Comparison operators assignment"
From WLCS
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
'''Directions:''' | '''Directions:''' | ||
− | # Open a | + | # Open a Google Doc |
# Put your name at the top | # Put your name at the top | ||
− | # Save the file as | + | # Save the file as '''Comparison operators assignment''' |
− | # Complete the exercises below in this file. | + | # Complete the exercises below in this file. |
# Be sure to number each of your answers!! | # Be sure to number each of your answers!! | ||
+ | # Include the question with the answer | ||
+ | # Submit your assignment via Canvas | ||
'''References:''' | '''References:''' | ||
+ | * [https://realpython.com/python-operators-expressions/#comparison-operators Real Python: Comparison Operators] | ||
* [http://openbookproject.net/thinkcs/python/english2e/ch04.html How to Think Like a Computer Scientist: Chapter 4] | * [http://openbookproject.net/thinkcs/python/english2e/ch04.html How to Think Like a Computer Scientist: Chapter 4] | ||
'''Exercises:''' | '''Exercises:''' | ||
* Evaluate the following comparisons as True or False | * Evaluate the following comparisons as True or False | ||
− | Assume x = | + | * Assume x = 6 and y = 4 |
# x > 2 | # x > 2 | ||
# y <= x | # y <= x | ||
− | + | # x == 2 | |
+ | # y != x | ||
+ | # x + 2 > y * 2 | ||
+ | # y * x < x * y | ||
+ | # x + x >= y * y | ||
+ | # 2*(x-10) < 0 | ||
+ | # y - 4 == x - 6 | ||
+ | # x / y > y / x | ||
'''Submit:''' | '''Submit:''' | ||
− | * Submit | + | * Submit your assignment via Canvas |
Latest revision as of 05:53, 19 September 2018
Directions:
- Open a Google Doc
- Put your name at the top
- Save the file as Comparison operators assignment
- Complete the exercises below in this file.
- Be sure to number each of your answers!!
- Include the question with the answer
- Submit your assignment via Canvas
References:
Exercises:
- Evaluate the following comparisons as True or False
- Assume x = 6 and y = 4
- x > 2
- y <= x
- x == 2
- y != x
- x + 2 > y * 2
- y * x < x * y
- x + x >= y * y
- 2*(x-10) < 0
- y - 4 == x - 6
- x / y > y / x
Submit:
- Submit your assignment via Canvas