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

iOS Swift Basics Swift Types Recap: Swift Types

Step 2 Help

Need help with Step 2 of this problem. Confused on creating string interpolation, how to write the code out, and understanding what goes where and why.

types.swift
// Enter your code below

let firstValue = 2

let secondValue = 4

let product = firstValue * secondValue

2 Answers

Alex Koumparos
seal-mask
.a{fill-rule:evenodd;}techdegree
Alex Koumparos
Python Development Techdegree Student 36,887 Points

Hi Timothy,

Pasan demonstrates string interpolation at around 10:37 in the strings video.

Which part of his explanation are you struggling with? The clearer you can be about what you don't understand the easier it will be to give you useful guidance.

Cheers

Alex

The part I donโ€™t understand is how to write it out in string interpolation

Alex Koumparos
seal-mask
.a{fill-rule:evenodd;}techdegree
Alex Koumparos
Python Development Techdegree Student 36,887 Points

How to write what out in string interpolation? Are you able to see and hear the video correctly? When he types:

let interpolatedAddress = "\(country), \(state), \(city)"

are you able to see that on your screen? Are you able to make the same code work on your computer? If not, that is one problem. If you are able to see his code and recreate it on your computer, is the problem that you don't understand what string interpolation is? Or is that you don't understand how the syntax works for string interpolation in Swift? Or is it that you don't understand what the challenge wants the output to look like? Each of these has a different answer, so we need to get a more specific explanation of what is causing you difficulties. Your question doesn't make it clear which of the above problems you are having, so it is currently impossible to help you.

The problem i am having is how to write it out in String Interpolation like how to word it and what symbols i need to use.