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

Variable

I try to get my code to work but it says i have the wrong value in my greeting variable

string_assignment.swift
var str = "greeting"


var hello = "hello"

var greeting = hello

What is it that they are asking you to perform?

They are asking me to create a variable named greeting and assign it a value of "Hello".

Okay, try not to overthink the question. Break it down logically...in your response to my comment you pretty much answered your question.

They are asking me to create a variable named greeting and assign it a value of "Hello".

create a variable : var named greeting: var greeting assign it a value of "Hello" : var greeting = "Hello"

you got it! Keep it up!

1 Answer

Could just be one of those simple cases where you just need to be meticulous on your upper and lower cases. Ensure that var hello = "Hello";