#How do I even start the Triangle categorisation question in Python

4 messages · Page 1 of 1 (latest)

dreamy finch
#

The question involves identifying if the triangle is isoceles, equilateral or scalene.
But the function for each categorisation has only one parameter.

def equilateral(sides):
    pass

And a triangle has 3 sides a,b,c.
Please guide me I am a complete beginner in python.

crimson tangle
#

What could sides be?

#

You're allowed to look at the tests

dire pumice
#

Hi! In the practice exercises you are supposed to read the tests. They are the specification.
This is the first test:

def test_all_sides_are_equal(self):
    self.assertIs(equilateral([2, 2, 2]), True)

You can see that it passes the argument [2, 2, 2] to the function equilateral and expects the result to be True.