I am a beginner python learner. I created this simple program but won’t display any error message neither does it work. After the input it stops working. What am I doing wrong? [ Python 3.2]
import math
print('''
|.
| .
a| . c
| .
|________.
b
''')
def robot():
a = float(input('Enter side a, 0 for unknown \n: '))
b = float(input('Enter side b, 0 for unknown \n: '))
c = float(input('Enter hypotenuse c, 0 for unknown \n: '))
if a == 0:
print = ('a = ', (math.sqrt((c**2)-(b**2))))
if b == 0:
print = ('b = ', (math.sqrt((c**2)-(a**2))))
if c == 0:
print = ('a = ', (math.sqrt((a**2)+(b**2))))
input()
robot()
robot()
Thanks
Delete the assignment operator after the
print.printis a function, so to call it you only have to provide the arguments in the parenthesis, like this: