+ 2

What wrong here??

I wrote this but I don’t know what’s wrong. A = input () B = input () print ("A ->\n ") print ("B -> \n") C= (A**2)+(B **2) print ( math.sqrt(C)) Thank you very much for your time.

30th Dec 2020, 3:38 PM
Neo
3 Antworten
+ 6
input always returns a string. Convert A and B to numeric type for performing arithmetic operations
30th Dec 2020, 3:43 PM
Lisa
Lisa - avatar
+ 6
A and B should equal int(input()) because you can't multiply a string by a string
30th Dec 2020, 3:43 PM
Slick
Slick - avatar
+ 3
the write code is import math A = int(input ()) B = int(input ()) print ("A ->\n ") print ("B -> \n") C= (A**2)+(B **2) print ( math.sqrt(C))
30th Dec 2020, 11:46 PM
L Boudhar
L Boudhar - avatar