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 trialCeonn Bobst
1,788 PointsHow should I proceed?
How should I proceed with the code?
I thought just changing the "return greeting" to "return (greeting, language)" would do it, but apparently not.
func greeting(person: String) -> String {
let language = "English"
let greeting = "Hello \(person)"
return greeting
}
1 Answer
Jhoan Arango
14,575 PointsHello Ceonn Bobst :
Well, you were on the right track, but you are missing something else.
func greeting(person: String) -> String { // tuple missing
let language = "English"
let greeting = "Hello \(person)"
return (greeting,language) // Your suggestion ?
/*
altho this is correct, you have to see your method signature.
Your method signature says that you are going to return a string,
but you need to return 2 strings. Which is a tuple.
*/
}
I donβt really want to give you straight up answer, because it may help you more to try to figure it out on your own with some help. BUT if you canβt figure it out, Ill be more than happy to explain with details.
Jhoan
Meek D
3,457 PointsMeek D
3,457 Pointswhat was the question asked ?