This page is located in archive.

This is an old revision of the document!

Right triangle

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
  • 1 point for manual evaluation (is the code readable)
courses/be5b33prg/homeworks/right_triangle.1443800978.txt.gz ยท Last modified: 2015/10/02 17:49 by svobodat