Practice problem using lambda inside the class in python 3

I am trying to check if the sum of all 3 sides of triangle is equal to 180 , if it is then it should output true else false,
I am using lamba function to implement it, as i want some practice.
This is what i tried but i am getting output as

<function Triangle.check_angles.<locals>.<lambda> at 0x000001E6146EF1E0>

instead i should be getting True or False, i really wanna use lamba here, do let me know what i am missing, thanks a lot in advance.

My code here:

class Triangle():
    def  __init__(self, angle1, angle2, angle3):
        self.angle1=angle1 
        self.angle2=angle2
        self.angle3=angle3
        self.number_of_sides=3
    
    def check_angles(self):
        return (lambda self:'True' if (self.angle1+self.angle2+self.angle3)==180 else 'False')


cal=Triangle(45,45,90)
print(cal.check_angles())

You should really reformat your code here, so that it displays as it should (indented).

To enter a code block into a forum post, precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

1 Like

Thanks for this, i have edited my post.