iOS Swift Basics Swift Types Recap: Swift Types

What am I doing wrong. I can't find the answer on here or docs.swift

let firstValue = 2 let secondValue = 4

let product = "firstProduct * secondProduct"

let output = "(firstValue) The product of 2 times 4 is 8 (secondValue) = 8"

types.swift
// Enter your code below

let firstValue = 2
let secondValue = 4 

let product = "firstProduct * secondProduct"


let output = "\(firstValue) The product of 2 times 4 is 8 \(secondValue) = 8"

1 Answer

Hi Devin,

You don't want to surround the product calculation (right side of the equals) in quotes. They are constant names, not strings.

Also, the constructed string uses the values held in the constants. So, for example:

let name = "Steve"

let output = " My name is \(name)"

You've added the values as hard-coded numbers. You just want to interpolate the values contained within firstValue, secondValue and output into the string you have created correctly.

Make sense?

Steve.