问:我在使用let firstValue = 10 let secondValue = 20 let product = firstValue * secondValue let interpolatedString =“(firstValue)乘以(secondValue)的乘积是(product)的乘积中出错。”
类型
//在下面输入您的代码
let firstValue = 10
let secondValue = 20
let product = firstValue * secondValue
let interString = “ \(firstValue )乘以\(secondValue )的值为\(product )”
答:您的代码是正确的,只需确保将您的最终字符串常量命名为output,而不是interString。
将此字符串分配给名为的常量 output
让 firstValue = 10
让 secondValue = 20
让 乘积 = firstValue * secondValue
让 输出 = “ \(firstValue )乘以\(secondValue )的乘积是\(product )”