Skip to content

Commit 82a1e93

Browse files
committed
adjust code
1 parent 27ac18c commit 82a1e93

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

projects/PyTriple.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ def pyTriple(a, b, c):
2525

2626
# Determine if the numbers form a pythagorean triple
2727
if lNoSq == (sNo1Sq + sNo2Sq):
28-
return 'Yes, this is a pythagorean triple.'
29-
return 'No, this is not a pythagorean triple.'
28+
return True
29+
return False
3030

3131
# Gather numbers from user
3232
print('Please enter three whole numbers. This function will check to see if they form a pythagorean triple.')
@@ -35,5 +35,7 @@ def pyTriple(a, b, c):
3535
userNoC = int(input('Please enter your third number: '))
3636

3737
# Call the function, print response
38-
response = pyTriple(userNoA, userNoB, userNoC)
39-
print(response)
38+
if pyTriple(userNoA, userNoB, userNoC):
39+
print('Yes, this is a pythagorean triple.')
40+
else:
41+
print('No, this is not a pythagorean triple.')

0 commit comments

Comments
 (0)