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 trialJames Jarrett
4,316 Pointsnot sure what I am doing wrong
I am following the video tutorial but I do not realize my error.
func greeting(#person: String) -> (greeting: String, language: String) {
let language = "English"
let greeting = "Hello \(person)"
return
}
2 Answers
Chris Shaw
26,676 PointsHi James,
You're almost there, you have setup your return type correctly as a tuple but you're not returning anything from the greeting
function. Rather than re-explaining what tuples are and how to use them see the link below which is a post I made a long time ago explaining them.
The other issue is you have changed the parameter person
to be named which isn't required, simply remove the pound/hash symbol so your function signature is instead the following.
func greeting(person: String) -> (greeting: String, language: String)
Hope that helps.
Jonas Kristensen
2,738 PointsIt still won't work