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 trialJoseph Savoia
568 PointsI am totally stumped..
I cannot get past this challenge.
"Challenge Task 1 of 2 Modify the existing greeting function to have an external parameter named person."
No matter how I modify this code, I keep getting the exact same error message. Can somebody please help me with the correct code here? As well as explaining this in a way someone who has been coding for 2 days can understand it?
Thanks a million!
func greeting(person: String) -> (greeting: String, language: String) {
let greeting = "Hello \(person)"
return (greeting)
}
3 Answers
Jonas Kristensen
2,738 Pointsfunc greeting(#person: String) {
println("Hello \(person)")
}
greeting(person: "Jerry")
Jonas Kristensen
2,738 PointsYou only have to put in # before person. You dont have to make a tuple, like you do. :-)
Joseph Savoia
568 PointsIt worked! Thanks so much man. I still have no idea why I don't have to add "->String".. guess I will trust the process :)
Jonas Kristensen
2,738 PointsYou are going to use tuples later, in the challenges. You're welcome :-)
Joseph Savoia
568 PointsI was just overthinking it haha. I understand now, thankfully!