This page is located in archive. Go to the latest version of this course pages. Go the latest version of this page.

01 - Right triangle

See the general homework guidelines!

Create a text file triangle.py. In it, define function is_right(a, b, c) which

  • accepts 3 natural numbers (positive integers) representing the side lengths of a triangle, and
  • checks whether the triangle is right, i.e. the function
    • returns True when the numbers a, b, c represent side lengths of a right triangle, and
    • returns False otherwise.

Assume that you will always get 3 positive integers as arguments. But DO NOT ASSUME that you will get them in any specific order!


  • 3 points for automatic checks
  • 2 point for manual evaluation (is the code readable, did you use the docstring to comment your function)
courses/be5b33prg/homework/regular/01_right_triangle.txt · Last modified: 2020/10/09 10:50 by nemymila