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 trialAndrew Condon
699 PointsI'm asking it to return two strings...but I don't think I'm doing this right at all. I'm lost.
Not sure exactly what else I have to do?
func greeting(person: String) -> (greeting:String,language:String) {
let language = "English"
let greeting = "Hello \(person)"
return greeting
}
2 Answers
Chris Shaw
26,676 PointsHi Andrew,
You're almost there, you just need to return a tuple based on the return type you set for the greeting
function like below.
func greeting(person: String) -> (greeting: String, language: String) {
let language = "English"
let greeting = "Hello \(person)"
return (greeting, language)
}
Happy coding!
Andrew Condon
699 PointsAh, great thanks!
I think the exercise is a lot simpler than the lesson before it. For some reason I tried all types of other stuff that was totally unnecessary.