the objective is to create a function to determine, from the three sides of a triangle, whether it is isosceles or not. I wrote the following code, yet its not very efficient, how could i have done this better? and is there anything wrong with this code? i tested it and it passed, but its a bit overly complicated for the task.
def isIsosceles(x, y, z):
l = [x, y, z]
for a in l:
for b in l:
if a <= 0:
return False
elif a == b:
if x == y or x == z:
return True
else:
return False