# Conditional Logic Operators


Try to think through the following conditionals before trying them out the playgroud. Will they evaluate to true or false?

```go
package main

import (
	"fmt"
)

func main() {
	fmt.Println(true && true)
	fmt.Println(true && false)
	fmt.Println(true || true)
	fmt.Println(true || false)
	fmt.Println(!true)
}
```

[playground](https://play.golang.org/p/ukFrlC66uv)

`&&` will return `true` if both sides evaluate to `true`, otherwise it will return `false`.

`||` will return `true` if either side evaluates to `true`.

`!` returns the opposite

Try [some examples](https://play.golang.org/p/cZEfXSIIDO) for yourself.

```go
package main

import (
	"fmt"
)

func main() {
	fmt.Printf("true && true\t %v\n", true && true)
	fmt.Printf("true && false\t %v\n", true && false)
	fmt.Printf("true || true\t %v\n", true || true)
	fmt.Printf("true || false\t %v\n", true || false)
	fmt.Printf("!true\t\t\t %v\n", !true)
}
```

[playground](https://play.golang.org/p/zRs5hDVmY2C)

