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 trialHakam Badwal
Courses Plus Student 748 PointsDont Know How To Do It
Can someone please send me the code for this challenge. I have tried to complete the challenge but I don't know what to do. Thanks.
1 Answer
Anthony Price
1,412 PointsHere is the answer:
func greeting(person: String) -> (greeting: String, language: String) {
let language = "English"
let greeting = "Hello \(person)"
return (greeting, language)
}
var result = greeting("Tom")
println(result.language)
Anthony Price
1,412 PointsAnthony Price
1,412 PointsThis is the first part:
Can't get the program to accept the following for task 2:
var result = greeting("Tom")