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 trialkevin nadjarian
1,498 PointsHi Tayler, thanks,
I just cannot get the code correct with a string :
func greeting(person: String) -> String { return "tom" }
println("hello (greeting("tom"))")
the result is "hello (Function)" and not hello tom
3 Answers
kevin nadjarian
1,498 PointsYes that what I did too sorry but I cannot get still have an issue
func greeting(person: String) -> String { return person }
println("hello (greeting("tom"))")
I also try with
func greeting(person: String) -> String { return person }
println("hello (greeting(tom))")
And also try
func greeting(person: String) -> String { return "tom" }
println("hello (greeting(tom))")
Can some one give me the correct answer for this exercices "Function return type" in Swift Functions and Optionals courses
Thank you
Jeremy Hayden
1,740 PointsYou forgot the / for string interpolation. "Hello /(greeting...
kevin nadjarian
1,498 PointsThe solution was like this, finded my answer.
func greeting(#personName: String) -> String { let greetings = "Hello, " + personName + "!" return greetings }
println(greeting(personName: "Kevin"))
Tyler Simko
5,610 PointsTyler Simko
5,610 PointsHey Kevin,
Hopefully I can help - what's your question?