Date: 01 September, 2023
Model: codellama-34b-instruct
Temperature: 0.2
Passing runs: 0
Total runs: 10
Success rate: 0%
def right_angle_triangle(a, b, c):
'''
Given the lengths of the three sides of a triangle. Return True if the three
sides form a right-angled triangle, False otherwise.
A right-angled triangle is a triangle in which one angle is right angle or
90 degree.
Example:
right_angle_triangle(3, 4, 5) == True
right_angle_triangle(1, 2, 3) == False
'''
The above is an incomplete Python code fragment. Return the complete and correct code with no additional text.
def right_angle_triangle(a, b, c):
'''
Given the lengths of the three sides of a triangle. Return True if the three
sides form a right-angled triangle, False otherwise.
A right-angled triangle is a triangle in which one angle is right angle or
90 degree.
Example:
right_angle_triangle(3, 4, 5) == True
right_angle_triangle(1, 2, 3) == False
'''return a*a == b*b + c*c or b*b == a*a + c*c or c*c == a*a + b*b
def check(candidate):
# Check some simple cases
assert candidate(3, 4, 5) == True, "This prints if this assert fails 1 (good for debugging!)"
assert candidate(1, 2, 3) == False
assert candidate(10, 6, 8) == True
assert candidate(2, 2, 2) == False
assert candidate(7, 24, 25) == True
assert candidate(10, 5, 7) == False
assert candidate(5, 12, 13) == True
assert candidate(15, 8, 17) == True
assert candidate(48, 55, 73) == True
# Check some edge cases that are easy to work out by hand.
assert candidate(1, 1, 1) == False, "This prints if this assert fails 2 (also good for debugging!)"
assert candidate(2, 2, 10) == False
Start time: 2023-09-01 02:46:01
Duration: 3.29s
Result: Fail
def right_angle_triangle(a, b, c):
return a**2 + b**2 == c**2
Start time: 2023-09-01 02:48:55
Duration: 3.14s
Result: Fail
def right_angle_triangle(a, b, c):
return a**2 + b**2 == c**2
Start time: 2023-09-01 02:51:53
Duration: 2.97s
Result: Fail
def right_angle_triangle(a, b, c):
return a**2 + b**2 == c**2
Start time: 2023-09-01 02:54:46
Duration: 5.82s
Result: Fail
def right_angle_triangle(a, b, c):
return a**2 + b**2 == c**2
Start time: 2023-09-01 02:57:45
Duration: 3.3s
Result: Fail
def right_angle_triangle(a, b, c):
return a**2 + b**2 == c**2
Start time: 2023-09-01 03:00:46
Duration: 3.12s
Result: Fail
def right_angle_triangle(a, b, c):
return a**2 + b**2 == c**2
Start time: 2023-09-01 03:03:48
Duration: 3.02s
Result: Fail
def right_angle_triangle(a, b, c):
return a**2 + b**2 == c**2
Start time: 2023-09-01 03:06:50
Duration: 3.79s
Result: Fail
def right_angle_triangle(a, b, c):
return a**2 + b**2 == c**2
Start time: 2023-09-01 03:09:53
Duration: 3.72s
Result: Fail
def right_angle_triangle(a, b, c):
return a**2 + b**2 == c**2
Start time: 2023-09-01 03:12:51
Duration: 3.33s
Result: Fail
def right_angle_triangle(a, b, c):
return a**2 + b**2 == c**2