0

whay this code is not working

distance calculater https://code.sololearn.com/cQ6vrdOGC89k/?ref=app

16th Feb 2020, 10:54 AM
Somil Khandelwal
9 ответов
+ 5
Somil Khandelwal You can check this code edited by me. Here you can find that how we can print returned value in different ways. https://code.sololearn.com/ca77BHk8rPUV/?ref=app
16th Feb 2020, 11:25 AM
A͢J
A͢J - avatar
+ 3
you're printing the function itself, not the result of the function try print(co_ordinate(2,8,5,6)) or result = co_ordinate(2,8,5,6) print(result)
16th Feb 2020, 11:13 AM
Taste
Taste - avatar
+ 3
what does it mean output- <function co_ordinate at 0x7fa098269efo> You are getting this because you are printing function which will not print the returned value. Actually when you print function it print the memory address. To print the returned value just call that function.
16th Feb 2020, 11:17 AM
A͢J
A͢J - avatar
+ 2
Just write square_root(s) instead of math.square_root(s).
16th Feb 2020, 10:58 AM
HonFu
HonFu - avatar
+ 1
https://code.sololearn.com/cinedmKJe8K3/?ref=app This is my correction. You tried to print(co_ordinate) this printed the memory address where the function co_ordinate is stored. You should pass it in print as i have shown in the attached code.
16th Feb 2020, 11:13 AM
Salman Nazeer
Salman Nazeer - avatar
+ 1
From a maths stand point, distance formula is s = √[ (x1 - x2)^2 + (y1 - y2)^2 ] so there's that as well.
16th Feb 2020, 11:15 AM
Salman Nazeer
Salman Nazeer - avatar
0
what does it mean output- <function co_ordinate at 0x7fa098269efo>
16th Feb 2020, 11:02 AM
Somil Khandelwal
0
Thanks bro😀
16th Feb 2020, 11:16 AM
Somil Khandelwal
0
THANKS BRO😀
16th Feb 2020, 11:20 AM
Somil Khandelwal