Initial commit
This commit is contained in:
22
06-variables/02-declarations/questions/01-what.md
Normal file
22
06-variables/02-declarations/questions/01-what.md
Normal file
@ -0,0 +1,22 @@
|
||||
# QUESTIONS: What's a variable?
|
||||
|
||||
* **Where does a variable live?**
|
||||
* Hard Disk
|
||||
* Computer Memory - *CORRECT*
|
||||
* CPU
|
||||
|
||||
* **What do you use a variable's name for?**
|
||||
* To be able to access it later - *CORRECT*
|
||||
* It's just a label
|
||||
* I don't need to use it
|
||||
|
||||
* **How to change the value of a variable?**
|
||||
* By using its name - *CORRECT*
|
||||
* By using its value
|
||||
* By asking to Go
|
||||
|
||||
* **After its declaration can you change the variable's type?**
|
||||
* Yes : Go is dynamically-typed
|
||||
* No : Go is statically-typed - *CORRECT*
|
||||
* Both: Go supports both of them
|
||||
|
21
06-variables/02-declarations/questions/02-declaration.md
Normal file
21
06-variables/02-declarations/questions/02-declaration.md
Normal file
@ -0,0 +1,21 @@
|
||||
## Which statement do you need to use for declaring variables?
|
||||
* name int
|
||||
* vars string name
|
||||
* var name integer
|
||||
* var width int *CORRECT*
|
||||
|
||||
## Which sentence below is correct?
|
||||
* You can use a variable before declaring it
|
||||
* You have to declare a variable before using it *CORRECT*
|
||||
|
||||
## What kind of language is Go?
|
||||
* Weakly-Typed
|
||||
* Dynamically-Typed
|
||||
* Strongly-Typed *CORRECT*
|
||||
* Freely-Typed
|
||||
|
||||
## Which variable name below is correct?
|
||||
* int
|
||||
* four *CORRECT*
|
||||
* 2computers
|
||||
* one?there
|
@ -0,0 +1,14 @@
|
||||
## What happens when you don't use a declared variable in the block scope?
|
||||
* Nothing, it will work fine
|
||||
* It will get removed automatically
|
||||
* The program won't compile *CORRECT*
|
||||
|
||||
## What happens when you don't use a declared variable in the package scope?
|
||||
* Nothing, it will work fine *CORRECT*
|
||||
* It will get removed automatically
|
||||
* The program won't compile
|
||||
|
||||
## How can you prevent unused variable error?
|
||||
* You can change the variable's name
|
||||
* You can use a blank-identifier to discard it *CORRECT*
|
||||
* You can change the variable's type
|
23
06-variables/02-declarations/questions/04-zero-values.md
Normal file
23
06-variables/02-declarations/questions/04-zero-values.md
Normal file
@ -0,0 +1,23 @@
|
||||
## Which type's zero value is 0?
|
||||
- bool
|
||||
- pointer
|
||||
- string
|
||||
- all numeric types *CORRECT*
|
||||
|
||||
## Which type's zero value is false?
|
||||
- bool *CORRECT*
|
||||
- pointer
|
||||
- string
|
||||
- all numeric types
|
||||
|
||||
## Which type's zero value is ""?
|
||||
- bool
|
||||
- pointer
|
||||
- string *CORRECT*
|
||||
- all numeric types
|
||||
|
||||
## Which type's zero value is nil?
|
||||
- bool
|
||||
- pointer *CORRECT*
|
||||
- string
|
||||
- all numeric types
|
Reference in New Issue
Block a user