0
when i try to run a code it does not show any error instead the only testcase is hidden!!! what should i do?
in python data structure course i'm writing a code of tuple unpacking but it shows the test case is hidden so i cannot go forward in that course!! please help!
5 odpowiedzi
+ 3
Show your code. Mention the task number.
+ 3
Akash Kumar
Python Data Structures
Module 17.2
Mapping Software
This is the challenge details, now show us your attempt so we may guide you to an understanding of the requirements
+ 3
Akash Kumar
I believe you have not applied the correct mathematical formula.
Try this instead
dist[d]= math.sqrt((x**2) + (y**2))
+ 1
i don't know how to interact with someone on this site
topic:- Tuple unpacking
code:-
import math
points = [
(12, 55),
(880, 123),
(64, 64),
(190, 1024),
(77, 33),
(42, 11),
(0, 90)
]
dist=list(range(len(points)))
d=0
for (x,y) in points:
dist[d]= math.sqrt(x**2) + math.sqrt(y**2)
d+=1
print(min(dist))
+ 1
thank you Rik wittkopp!!
done!