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 trialOr Alkalay
Courses Plus Student 253 PointsWhat's the solution? how do I print what should've?
help please
// Enter your code below
let firstValue: Int = 2
let secondValue: Int = 4
let product: Int = firstValue * secondValue
let stri: String = "The product of \(firstValue) times \(secondValue) is \(product)"
1 Answer
andren
28,558 PointsYour code is fine. The issue is that you have named the last constant stri
, the task specifies that it has to be named output
. If you rename it like this:
let output: String = "The product of \(firstValue) times \(secondValue) is \(product)"
Then you will be able to complete the challenge.
Or Alkalay
Courses Plus Student 253 PointsOr Alkalay
Courses Plus Student 253 Pointsit's still not working. it's saying: Bummer! Your code could not be compiled. Please click on "Preview" to view the compiler errors.
and the errors are :swift_lint.swift:8:12: error: consecutive statements on a line must be separated by ';' let product Int = firstValue * secondValue ^ ; swift_lint.swift:8:5: error: type annotation missing in pattern let product Int = firstValue * secondValue ^ swift_lint.swift:8:17: error: cannot assign to immutable expression of type 'Int.Type' let product Int = firstValue * secondValue ~~~ ^
Or Alkalay
Courses Plus Student 253 PointsOr Alkalay
Courses Plus Student 253 Pointsok now it's fine.. thanks