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 trial
Mohammad Rehman
Courses Plus Student 2,416 Pointshow do i do this question?
2 Answers
Vittorio Somaschini
33,371 PointsHello Mohammad.
Kyle's code is good, you can have a look at it to see what is needed to pass the code challenge.
Here is a quick explanation:
the "-> String" part actually specifies what we what to return with this function and in this case what we want is a string.
The second part of the question asks you to change the print into a return statement, so we only change the keyword here.
Kyle Vandeven -> Thanks for your answer mate. If you could add a little explanation to your code next time, that would be awesome! Not only it makes things easier for the guy who asked the question, but it helps you with terminology, concepts, ecc... as well.
Keep up with the good job!
Thanks
Vittorio
kjvswift93
13,515 PointsLike this:
func greeting(person: String) -> String {
return("Hello \(person)")
}
kjvswift93
13,515 Pointskjvswift93
13,515 PointsI will start doing that more from now on!