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 Swift Types Mixed Types

the number question isn't it ?

var rating : Double = 7.5

??

types.swift
// Enter your code below
Var rating : Double = 7.5

3 Answers

Jaroslaw Adamowicz
Jaroslaw Adamowicz
11,634 Points

Hi, both answers from Giorgos Karyofyllis and Mark Carrel are correct!

var is keyword, and language itself is case sensitive.

So var is not the same as Var or VAR or vAr...

All are different.

Also var is not a type! And only types are written (or should be) with capital first letter. So:

var, struct, while, do, let -> all small letters

String, Double, Int -> types, all start with capital letter

true, false -> actually theese are values of type Bool and maybe considered as keywords as well, so small caps of course

Hope it helps a little!

Cheers!

thank u so much

Mark Carrel
Mark Carrel
9,873 Points

I think the problem may be that the code has "var" written with an uppercase 'V"? Should be lowercase.

thank u

Giorgos Karyofyllis
Giorgos Karyofyllis
21,276 Points
let title = "A Dance with Dragons"
var rating = 7.5
var isAvailable = false