Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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,859 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,859 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.