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 Basics (retired) Types Numbers

How to do it?

How to do it?

numbers.swift
var title = "A dace with Dragons"

1 Answer

Martin Wildfeuer
PLUS
Martin Wildfeuer
Courses Plus Student 11,071 Points

Assignment: We need store some information about a book in several variables. Let's start with the title of book. Create a constant named title and assign it a string: "A Dance with Dragons".

First of all, the assignment asks us to create a constant. Unlike a variable, which is defined by the var keyword, you need to create the constant with the let keyword.

Moreover, the string we assign has to be "A Dance with Dragons", not "A dace with Dragons".

Therefore, the solution would be:

let title = "A Dance with Dragons"

You were close, but it is very important to follow the assignment in detail. Code check won't usually let you pass if you have even the slightest variation, which is good :)

I hope that helps :)