Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialTariq Qazzaz
1,660 PointsMissing Somthing in my Tuple ?
Hi Guys // Enter your code below func coordinates (for location:String) -> (Double,Double) {
switch location { case "Eiffel Tower" : return (48.8582 , 2.2945) case "Great Pyramid" : return (29.97922 , 31.1344) case "Sydney Opera House" : return (33.8587 , 151.2140) default : return (0.0 , 0.0) }
}
i couldnt find the problem in my code ..
would you please help me
// Enter your code below
func coordinates (for location:String) -> (Double,Double) {
switch location {
case "Eiffel Tower" : return (48.8582 , 2.2945)
case "Great Pyramid" : return (29.97922 , 31.1344)
case "Sydney Opera House" : return (33.8587 , 151.2140)
default : return (0.0 , 0.0)
}
}
2 Answers
Jennifer Nordell
Treehouse TeacherHi there! You simply have a typo in one of the values you're returning. The problem is with the value returned by "Great Pyramid".
// You typed
return (29.97922 , 31.1344)
// That should be
return (29.9792 , 31.1344)
Note the removal of the extraneous 2 on the latitude of the second version.
Hope this helps!
István Halász
2,896 PointsHi, you only mistyped the Great Pyramids' coordinates. Instead of writing (29.9792, 31.1344), you wrote (29.97922 , 31.1344). You just wrote an extra 2 :)
Tariq Qazzaz
1,660 Pointsthank you so much .. it worked . easy mistake got me stuck for 30 minutes .
Tariq Qazzaz
1,660 PointsTariq Qazzaz
1,660 PointsAwww .. thank you so much . appreciate it .