Python: How do I approach the triangle categorisation problem?

The boilerplate for solution contains function for each triangle- equilateral, isosceles, scalene, but the function has only one variable ‘sides’ and a triangle needs three sides lest say a,b,c for comprison. Below is one of the function:

def equilateral(sides):
    pass

I am completely new to python, tell me if I am missing something here.

Let’s look at the tests.

One of the tests has

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

In this test, sides will be the list [2, 2, 2]

If we want, our solutions can start with

    a = sides[0]
    b = sides[1]
    c = sides[2]
2 Likes

Please don’t ask the same question in multiple places (Discord) :slight_smile:
Ask in one place and give people a chance to answer. Hang around a bit so you can engage.

1 Like