package main
import "fmt"
func plus(a ...int) int {
var total int
for _, item := range a {
total += item
}
return total
}
func main() {
name := "asdf;lkjasdf;lkjasdf"
for _, letter := range name {
fmt.Println(string(letter))
}
}
package main
import "fmt"
func main() {
foods := [3]string{"potato", "pizza", "pasta"}
for _, food := range foods {
fmt.Println(food)
}
}
package main
import "fmt"
func main() {
foods := [3]string{"potato", "pizza", "pasta"}
for i := 0; i < len(foods); i++ {
fmt.Println(foods[i])
}
}
package main
import "fmt"
func main() {
foods := []string{"potato", "pizza", "pasta"}
fmt.Printf("%v\n", foods)
foods = append(foods, "tomato")
fmt.Printf("%v\n", foods)
}