## How can you simplify the following code? You only need to change the condition expression, but how?
```go
package main
import "fmt"
func main() {
happy := false
if happy == !true {
fmt.Println("why not?")
}
}
```
1. Easy! Like this: `happy != true`
2.`!happy`*CORRECT*
3.`happy == false`
4.`!happy == false`
> **1, 3:** Right! But you can do it better.
>
> **2:** Perfect! You don't need to compare the value to `false` or to `!true` (which is false). `!happy` already returns true, because it's false at the beginning.
>
> **4:** That won't print anything. `happy` will be true.
> **1:** Right. There can be only one else branch.
>
> **2:** If there's an else branch, you can't move else if branch as the last branch.
>
> **3, 4:** So? :) That's not the cause of the problem.
>
## What's the problem with the following code?
```go
package main
import "fmt"
func main() {
happy := true
energic := happy
if happy {
fmt.Println("cool!")
} else if !happy {
fmt.Println("why not?")
} else if energic {
fmt.Println("working out?")
}
}
```
1. It declares the energic variable unnecessarily.
2. You can't use more than one else if branch.
3. It will never run the last else if branch. *CORRECT*
4. There's no else branch.
> **2:** Well, actually you can.
>
> **3:** Right. `happy` can only be either true or false. That means, it will always execute the first two branches, but it will never execute the else if branch.
>
> **4:** It doesn't have to be. Else branch is optional.
## How can you simplify the following code?
```go
package main
import "fmt"
func main() {
happy := false
if happy {
fmt.Println("cool!")
} else if happy != true {
fmt.Println("why not?")
} else {
fmt.Println("why not?")
}
}
```
1. Change `else if`'s condition to: `!happy`.
2. Move the else branch before else if.
3. Remove the else branch.
4. Remove the else if branch. *CORRECT*
> **1, 3:** Close! But, you can do it even better.