Difference between revisions of "Comparison operators assignment"

From WLCS
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
'''Directions:'''
 
'''Directions:'''
# Open a text editor (Applications->Accessories->gEdit Text Editor)
+
# Open a Google Doc
 
# Put your name at the top
 
# Put your name at the top
# Save the file as YOURLASTNAME_comparison.txt
+
# Save the file as '''Comparison operators assignment'''
# Complete the exercises below in this file. If you use DrPython, then be sure to copy your code back into 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]
  
Line 24: Line 27:
  
 
'''Submit:'''
 
'''Submit:'''
* Submit the file to [http://wlhs.schoolweblockers.com/ School Web Lockers]
+
* Submit your assignment via Canvas

Latest revision as of 05:53, 19 September 2018

Directions:

  1. Open a Google Doc
  2. Put your name at the top
  3. Save the file as Comparison operators assignment
  4. Complete the exercises below in this file.
  5. Be sure to number each of your answers!!
  6. Include the question with the answer
  7. Submit your assignment via Canvas

References:

Exercises:

  • Evaluate the following comparisons as True or False
  • Assume x = 6 and y = 4
  1. x > 2
  2. y <= x
  3. x == 2
  4. y != x
  5. x + 2 > y * 2
  6. y * x < x * y
  7. x + x >= y * y
  8. 2*(x-10) < 0
  9. y - 4 == x - 6
  10. x / y > y / x

Submit:

  • Submit your assignment via Canvas