How to use foreach loop in Go

1 Answer

0 votes
package main

import "fmt"

func main() {

	arr := []string{"go", "c++", "php", "python"}

	for _, s := range arr {
		fmt.Println(s)
	}
}
 
 
 
/*
run:
 
go
c++
php
python
 
*/

 



answered Aug 7, 2020 by avibootz

Related questions

1 answer 100 views
1 answer 115 views
4 answers 258 views
258 views asked Jun 10, 2023 by avibootz
1 answer 196 views
196 views asked Oct 28, 2020 by avibootz
1 answer 184 views
184 views asked Oct 28, 2020 by avibootz
1 answer 195 views
195 views asked Oct 28, 2020 by avibootz
1 answer 197 views
...