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 trialmitchell daw
2,407 PointsI am really confused as to what they want us to modify in this code. Any hints?
What is the first step?
func greeting(person: String) -> String {
let language = ("English","Hello \(person)")
let greeting = ("Hello \(person)")
return greeting
}
1 Answer
Evan Demaris
64,262 PointsHi Mitchell,
As the Challenge is asking for both greeting and language to be returned as a tuple, you'd want to include that each is a string being returned - not just a single string, then just add the language to the return statement.
func greeting(person: String) -> (greeting: String, language: String) {
let language = "English"
let greeting = "Hello \(person)"
return (greeting, language)
}
Hope that helps!
Helgi Helgason
7,599 PointsHelgi Helgason
7,599 PointsChange the function so it will return a tuple