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 trialRichard Pitts
Courses Plus Student 1,243 PointsAnswer? Am I close?
Answer? Am I close?
// Enter your code below
let "Eiffel Tower" = (lat: 48.8582, lon: 2.2945)
let "Great Pyramid" = (lat: 29.9792, lon: 31.344)
let "Sydney Opera House" = (lat: 33.8587, lon: 151.2140)
func coordinates(for location: String) -> (Double, Double) {}
1 Answer
Raphael Reiter
6,820 PointsPlease don't read this before figuring out the switch statement. hope it helped
func coordinates(for location: String) -> (Double, Double) { switch location { case "Eiffel Tower": return (48.8582, 2.2945) case "Great Pyramid": return (29.9792, 31.1344) case "Sydney Opera House": return (33.8587, 151.2140) default: return (0,0) } }
Raphael Reiter
6,820 PointsRaphael Reiter
6,820 PointsHey Richard, before giving you the solution, maybe you can try to use a switch statement? so that given the String "Eiffel Tower" we get the 2 Doubles (lat lon) etc? good luck :)