0
whay this code is not working
distance calculater https://code.sololearn.com/cQ6vrdOGC89k/?ref=app
9 odpowiedzi
+ 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
+ 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)
+ 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.
+ 2
Just write square_root(s) instead of math.square_root(s).
+ 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.
+ 1
From a maths stand point, distance formula is
s = √[ (x1 - x2)^2 + (y1 - y2)^2 ]
so there's that as well.
0
what does it mean
output-
<function co_ordinate at 0x7fa098269efo>
0
Thanks bro😀
0
THANKS BRO😀