Playing with arrays

This commit is contained in:
raul 2024-01-26 18:53:59 +01:00
parent dd1849da8e
commit bb1cf72840
2 changed files with 24 additions and 0 deletions

3
golangr/array/go.mod Normal file
View File

@ -0,0 +1,3 @@
module array
go 1.21.6

21
golangr/array/main.go Normal file
View File

@ -0,0 +1,21 @@
package main
import (
"fmt"
)
func main() {
var notafinal int = 0
numbers := []int{9, 9, 10}
for i := 0; i < len(numbers); i++ {
notafinal = notafinal + numbers[i]
}
fmt.Println("La notas combinadas suman", notafinal)
// numbers = append(numbers, 1)
// fmt.Println(len(numbers))
// fmt.Println(numbers)
}