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 204 views
1 answer 237 views
4 answers 450 views
450 views asked Jun 10, 2023 by avibootz
1 answer 286 views
286 views asked Oct 28, 2020 by avibootz
1 answer 296 views
296 views asked Oct 28, 2020 by avibootz
1 answer 283 views
283 views asked Oct 28, 2020 by avibootz
1 answer 288 views
...