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 2.0 Basics Swift Types Recap: Swift Types

For this challenge, let's pretend we're building a calculator that outputs a string with the result of a math operation.

For this challenge, let's pretend we're building a calculator that outputs a string with the result of a math operation.

Start by declaring two constants, firstValue and secondValue and to both of them assign some integer values (whatever you want! don't go too crazy though) Im Trying this code.

let firstVale: Int = 3 let secondValue: Int = 4 3+4 var Int = 3.0 firstVale + secondValue

types.swift
let firstVale: Int = 3
let secondValue: Int = 2
firstVale + secondValue

1 Answer

Tobias Helmrich
Tobias Helmrich
31,602 Points

Hey there Karthik,

the problem why you're not passing the task is that the first constant has to be called firstValue instead of firstVale. Also note that you don't have to use type annotation here and that you don't have to add both values together for the first task but if you want to that's fine as well! :)

The solution for the first task could look like this:

let firstValue = 3
let secondValue = 2

I hope that helps! :)