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!

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) Variables and Constants Variables


i need help with this state meant You need to define a variable with what does this mean i am new to programing

`var greeting`
var greeting =" hello"

Var str = "greeting"

2 Answers

Chase Marchione
Chase Marchione
155,055 Points

Hi Robert,

When declaring a variable, you do want to use the var keyword, but you want it to be all lower-case ('Var' would theoretically mean something different in Swift... this concept of uppercase and lowercase letters having different meanings means that Swift is a 'case sensitive' language.) Your variable name goes next in your declaration statement. After the equals sign, you'll type the value that you want to be stored into the variable. In this example it's a text value (a 'String' value), and you need to put that type of value in double quotes.

var greeting = "Hello"

Hope this helps!

What does this mean? Your greeting variable has the wrong value in it. I am new at programing. Thanks ' ' ' var greeting = "hello"