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 trialBen Holland
Courses Plus Student 4,062 PointsI just don't get This Tuples Question ?
func greeting(person: String) -> String {
let language = "English"
let greeting = "Hello \(person)"
return greeting
}
This is my code that it came with how can i get these all done im so confuses i have reviewed and reviewed all videos regarding Tuples .
2 Answers
Ethan Lowry
Courses Plus Student 7,323 PointsYour problem there is nothing to do with tuples, but with how to do string interpolation (where you're trying to insert the 'person' variable into your string).
You may want to either look up Swift string interpolation or go back and rewatch the relevant Swift Basics video lessons here - I'm sure you'll see your mistake soon then.
Ben Holland
Courses Plus Student 4,062 PointsI've tried This :
func greeting(person: String) -> String {
let language = "English"
let greeting = ("Hello \(person)", langauge: language)
return greeting
}
I know about String Interpolation and i can't get it with this scenario i'm also looking at this site for help :
Ethan Lowry
Courses Plus Student 7,323 PointsHi - like I said, you are making a mistake with your string interpolation. Read the code in that article you posted carefully, and you will see quite early on there is an example of string interpolation you can copy.
Also I know it's quite confusing but remember to respond to answers here by pressing the 'Add Comment' button below an answer (like I am now) rather than adding a new answer everytime to discuss things, like you (and lots of other people all the time) just did :)