+ 1

where is it wrong? if anyone knows then please make it correct.

import math print("Enter first number ") a=int(input( )) print("Enter second number ") b=int(input( )) print("Enter third number ") c=int(input( )) print("Enter Fourth number ") d=int(input( )) print("Distance is ") e=((c-a)*2) f=((d-b)*2) g=(e+f) h=(math.sqrt(g)) print("Result") print(h) import sys usr_input = input() if usr_input == "close": sys.quit(0)

14th May 2018, 12:35 PM
Anmol Dhakal
3 odpowiedzi
+ 1
i checked this with calc. seems to be working correctly Lets say input is 1234 which makes e = 4 f = 4 g = 8 and so square root of 8 is 2.828427... and if you check if it is the square root by doing h**2 it will result 8.00000000000002 which is basically 8
15th May 2018, 3:11 PM
Markus Kaleton
Markus Kaleton - avatar
+ 1
seems to work just fine. if you are running it on sololearn you have to give all inputs right at the beginning =5 inputs
14th May 2018, 1:42 PM
Markus Kaleton
Markus Kaleton - avatar
+ 1
h=(math.sqrt(g)) this line it's not working look ahead
15th May 2018, 5:22 AM
Anmol Dhakal