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 trialBrady Coye
1,839 PointsI'm not sure what to do. I'm pretty sure this is the right answer... I've been stuck for awhile
challenge #2
func greeting(person: String) -> (language: String, greeting: String) {
let language = "English"
let greeting = "Hello \(person)"
var newGreeting = (language, greeting)
return newGreeting
}
var result = greeting("Tom")
Florin Veja
6,912 PointsI was able to copy and paste your code into the challenge question and it worked for me. Can you provide more information as to what you are having issues with?
3 Answers
Florin Veja
6,912 PointsThis is the right answer. I was able to copy and paste your code into the Challenge and it worked.
Daniel Taylor
1,504 PointsBrady,
Here is what I used:
func greeting(person: String) -> (greeting: String, language: String) {
let language = "English"
let greeting = "Hello \(person)"
return(greeting, language)
}
var result = greeting("Tom")
Brady Coye
1,839 PointsThanks, I fixed it. It would only accept my answer after I changed the order to (greeting, language) instead of (language, greeting). Very annoying.... I wasted 45 mins trying to figure out what I did wrong. It seems like a bug because return order shouldn't matter for this exercise. Ugh.
Florin Veja
6,912 PointsFlorin Veja
6,912 PointsBrady, can you post the Challenge question?