From 719c6f37f0b11303512fa54a4ce5b6a368660aaf Mon Sep 17 00:00:00 2001 From: sebastian Date: Wed, 27 Sep 2023 13:08:23 +0200 Subject: [PATCH] Section3.16 --- Section4/main.go | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Section4/main.go diff --git a/Section4/main.go b/Section4/main.go new file mode 100644 index 0000000..48305eb --- /dev/null +++ b/Section4/main.go @@ -0,0 +1,45 @@ +package main + +import "fmt" + +func main() { + var age int = 44 + fmt.Println("Age:", age) + + var name = "Seb" + fmt.Println("Name:", name) + + s := "Learning golang" + fmt.Println(s) + + car, cost := "Audi", 50000 + fmt.Println(car, cost) + + car, year := "BMW", 2018 + _ = year + + var opened = false + opened, file := true, "a.txt" + _, _ = opened, file + + var ( + salary float64 + firstName string + gender bool + ) + fmt.Println(salary, firstName, gender) + + var a, b, c int + fmt.Println(a, b, c) + + var i, j int + i, j = 5, 8 + + j, i = i, j + + fmt.Println(i, j) + + sum := 5 + 2.3 + fmt.Println(sum) + +}