Initial commit

This commit is contained in:
Inanc Gumus
2018-10-13 23:30:21 +03:00
commit cde4e6632c
567 changed files with 17896 additions and 0 deletions

View File

@ -0,0 +1,31 @@
// 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
// Declare and then print four variables
// using the short declaration statement
//
// EXPECTED OUTPUT
// i: 314 f: 3.14 s: Hello b: true
// ---------------------------------------------------------
func main() {
// ADD YOUR DECLARATIONS HERE
//
// THEN UNCOMMENT THE CODE BELOW
// fmt.Println(
// "i:", i,
// "f:", f,
// "s:", s,
// "b:", b,
// )
}

View File

@ -0,0 +1,26 @@
// 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
import (
"fmt"
)
func main() {
i := 314
f := 3.14
s := "Hello"
b := true
fmt.Println(
"i:", i,
"f:", f,
"s:", s,
"b:", b,
)
}

View File

@ -0,0 +1,25 @@
// 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
// Declare two variables using multiple short declaration
//
// EXPECTED OUTPUT
// 14 true
// ---------------------------------------------------------
func main() {
// ADD YOUR DECLARATIONS HERE
//
// THEN UNCOMMENT THE CODE BELOW
// fmt.Println(a, b)
}

View File

@ -0,0 +1,18 @@
// 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
import (
"fmt"
)
func main() {
a, b := 14, true
fmt.Println(a, b)
}

View File

@ -0,0 +1,28 @@
// 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
// 1- Declare two variables using short declaration
//
// 2- `a` variable's value should be 42
// 3- `c` variable's value should be "good"
//
// EXPECTED OUTPUT
// 42 good
// ---------------------------------------------------------
func main() {
// ADD YOUR DECLARATIONS HERE
//
// THEN UNCOMMENT THE CODE BELOW
// fmt.Println(a, c)
}

View File

@ -0,0 +1,18 @@
// 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
import (
"fmt"
)
func main() {
a, c := 42, "good"
fmt.Println(a, c)
}

View File

@ -0,0 +1,25 @@
// 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
// 1- Short declare a variable named `sum`
// 2- Initialize it with an expression by adding 27 and 3.5
//
// EXPECTED OUTPUT
// 30.5
// ---------------------------------------------------------
func main() {
// ADD YOUR DECLARATION HERE
//
// THEN UNCOMMENT THE CODE BELOW
// fmt.Println(sum)
}

View File

@ -0,0 +1,18 @@
// 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
import (
"fmt"
)
func main() {
sum := 27 + 3.5
fmt.Println(sum)
}

View File

@ -0,0 +1,34 @@
// 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
// 1- Short declare two bool variables
// (use multiple short declaration syntax)
//
// 2- Initialize both variables to true
//
// 3- Change your declaration and
// discard the 2nd variable's value
// using the blank-identifier
//
// 4- Print only the 1st variable
//
// EXPECTED OUTPUT
// true
// ---------------------------------------------------------
func main() {
// ADD YOUR DECLARATIONS HERE
//
// THEN UNCOMMENT THE CODE BELOW
// fmt.Println(on)
}

View File

@ -0,0 +1,20 @@
// 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
import (
"fmt"
)
func main() {
// You can discard values in a short declaration
on, _ := true, true
fmt.Println(on)
}

View File

@ -0,0 +1,33 @@
// 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
// 1- Short declare two int variables: age and yourAge
// (use multiple short declaration syntax)
//
// 2- Short declare a new float variable: ratio
// And, change the 'age' variable to 42
//
// (! You should use redeclaration)
//
// 4- Print all the variables
//
// EXPECTED OUTPUT
// 42, 20, 3.14
// ---------------------------------------------------------
func main() {
// ADD YOUR DECLARATIONS HERE
//
// THEN UNCOMMENT THE CODE BELOW
// fmt.Println(age, yourAge, ratio)
}

View File

@ -0,0 +1,19 @@
// 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
import (
"fmt"
)
func main() {
age, yourAge := 10, 20
age, ratio := 42, 3.14
fmt.Println(age, yourAge, ratio)
}