From 3d936bc773968e20daeb6d95aaef77a9ab3ae4fa Mon Sep 17 00:00:00 2001 From: Firas Khalil Khana Date: Sat, 1 May 2021 13:21:54 +0300 Subject: [PATCH] Fix typos in 12 questions --- 12-switch/questions/questions.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/12-switch/questions/questions.md b/12-switch/questions/questions.md index 8af651e..e673fe8 100644 --- a/12-switch/questions/questions.md +++ b/12-switch/questions/questions.md @@ -1,14 +1,14 @@ ## What's the difference between if and switch statements? -1. If statement controls the execution flow but the switch statement does not -2. If statement is much more readable alternative to a switch statement -3. Switch statement is much more readable alternative to a if statement *CORRECT* +1. If statements control the execution flow but switch statements do not +2. If statements are much more readable alternatives to switch statements +3. Switch statements are much more readable alternatives to if statements *CORRECT* > **1:** They both control the execution flow. > > **2:** Sometimes true, but, for complex if statements, switch statement can make them much more readable. -## What type of values you can use as a switch condition? +## What type of values can you use as a switch condition? ```go switch condition { // .... @@ -22,7 +22,7 @@ switch condition { > **4:** Unlike most other C based languages, in Go, a switch statement is actually a syntactic-sugar for a if statement. This means that, Go converts a switch statement into an if statement behind the scenes. So, any type of values can be used as a condition. -## What type of values you can use as the case conditions for the following switch statement? +## What type of values can you use as the case conditions for the following switch statement? ```go switch false { case condition: @@ -37,7 +37,7 @@ case condition: > **2:** Yes, you can only use bool values because in the example, the switch's condition is a bool. -## What type of values you can use as the case conditions for the following switch statement? +## What type of values can you use as the case conditions for the following switch statement? ```go switch "go" { case condition: @@ -183,4 +183,4 @@ case n == 8: 2. "n is 8" 3. "n is big" *CORRECT* -> **3:** That's right! Switch runs top-to-bottom and case conditions run left-to-right. Here, 1st case's 1st condition expression (which is n > 5) will yield true, so the 1st case will be executed. \ No newline at end of file +> **3:** That's right! Switch runs top-to-bottom and case conditions run left-to-right. Here, 1st case's 1st condition expression (which is n > 5) will yield true, so the 1st case will be executed.