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 trialBen Bastow
24,657 Pointstuples 3/3
hai!
i dunno how to this challange for the pt3 i think im being really really stupid now! cause i think everyone else has got this and i think im the only one who doesnt understand this!! I have got through basics and this fine untill now!!
My code:
func greeting(person: String) -> (greeting: String, language: String) {
let language = "English"
let greeting = "Hello \(person)"
return (greeting, language)
println("\(language)")
}
var result = greeting("Tom")
Ben Bastow
24,657 Pointsthanks so muchhhh!!!!!!! it makes sense now!!! :D
1 Answer
Ricardo Hill-Henry
38,442 PointsThe challenge wants you to get the language element from the tuple that resuly currently holds. What you're doing is having every tuple created using greeting print out language.
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)
Ben Bastow
24,657 Pointsthanks!!!!!! i get it now!!!
Christian Kristoffersen
32,531 PointsChristian Kristoffersen
32,531 PointsHey Ben, You have to print it out like this: