conditions and options in swift
Triecie77 (0)

let temperature = 68

If temperature < 68 {
print("the Air Conditioning should be turned off")

}else if temperature >= 68
print("the air conditioning should be turned on")

You are viewing a single comment. View All
vedprad1 (694)

You have three problems:
1. The If should be lowercase, like this: if.
2. You do not need an else if, just an else.
3. The second print should also be surrounded by braces, like this: {}.

Your final product should look like this:

let temperature = 68

if temperature < 68 {
print("the Air Conditioning should be turned off")

}else {
print("the air conditioning should be turned on")
}

If this answers your question, please check the checkmark on the left side of this message. Thanks and Good Luck!