fix: questions typos of the if statement section

This commit is contained in:
Inanc Gumus
2018-10-21 23:16:30 +03:00
parent a29cb99fcb
commit 2db3731b25
7 changed files with 22 additions and 55 deletions

View File

@ -3,10 +3,10 @@
2. `!=`
3. `>` *CORRECT*
> **3:** That's the greater operator. It checks whether a ordered value is greater than the other or not.
> **3:** That's the greater operator. It checks whether an ordered value is greater than the other or not.
## Which one below is not one of the comparison operators of Go?
## Which one below is not one of the ordering operators of Go?
1. `>`
2. `<=`
3. `==` *CORRECT*
@ -24,7 +24,7 @@
> **3:** That's right. All the comparison operators return an untyped bool value (true or false).
## Which one of these cannot be used as an operand to ordering operators (`>`, `<`, `>=`, `<=`)?
## Which one of these below cannot be used as an operand to ordering operators (`>`, `<`, `>=`, `<=`)?
1. int value
2. byte value
3. string value

View File

@ -117,7 +117,7 @@ func main() {
// Don't mind about these functions.
// Just focus on the problem.
// These are here just for you to understand it better.
// They are here just for you to understand what's going on better.
func super() bool {
fmt.Print("super ")
return true

View File

@ -79,7 +79,7 @@ func main() {
>
> **3:** Perfect! You don't need to compare the value to `true`. `happy` is already true, so it'll print "cool!".
>
> **4:** That won't print anything. `happy` will be true.
> **4:** That won't print anything. `!happy` yields false.
## How can you simplify the following code? You only need to change the condition expression, but how?
@ -108,7 +108,7 @@ func main() {
> **4:** That won't print anything. `happy` will be true.
## Is this code going to work? Why?
## This code contains an error. How to fix it?
```go
package main

View File

@ -1,3 +1,16 @@
## Why error handling is needed?
1. I don't know.
2. To control the execution flow.
3. To make a program malware safe.
4. Because, things can go wrong. *CORRECT*
> **1:** Then, please watch the lecture again! :)
>
> **2:** Actually yes, but that's not the main reason.
>
> **3:** Come on!
## What's a nil value?
1. The dark matter that rules the universe.
2. It's a zero value for pointers or pointer-based types. It means the value is uninitialized. *CORRECT*
@ -13,25 +26,12 @@
>
## Why error handling is needed?
1. I don't know.
2. To control the execution flow.
3. To make a program malware safe.
4. Because, things can go wrong. *CORRECT*
> **1:** Then, please rewatch the lecture! :)
>
> **2:** Actually yes, but that's not the main reason.
>
> **3:** Come on!
## How Go handles error handling?
1. Using a throw/catch block
1. Using a throw/catch statement
2. Using a simple if statement with nil comparison *CORRECT*
3. Using a mechanism called tagging
> **1:** There isn't a throw/catch block in Go; unlike Java, C#, and so on... Go is explicit.
> **1:** There isn't a throw/catch statement in Go; unlike Java, C#, and so on... Go is explicit.
## When you should handle the errors?

View File

@ -62,7 +62,7 @@ func main() {
3. Change the done declaration of the main() to an assignment
4. Change the done declaration of the short-if to an assignment. And, after the if statement, assign false back to the done variable. *CORRECT*
> **1:** That will break the program. The last line tries to print it.
> **1:** That will break the program. Because, the last line prints it.
>
> **2:** The program wants to use it to print true.
>

View File

@ -1,22 +0,0 @@
// For more tutorials: https://blog.learngoprogramming.com
//
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
package main
// ---------------------------------------------------------
// EXERCISE
// ?
//
// NOTE
// ?
//
// EXPECTED OUTPUT
// ?
// ---------------------------------------------------------
func main() {
}

View File

@ -1,11 +0,0 @@
// For more tutorials: https://blog.learngoprogramming.com
//
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
package main
func main() {
}