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 197 views
1 answer 234 views
4 answers 444 views
444 views asked Jun 10, 2023 by avibootz
1 answer 281 views
281 views asked Oct 28, 2020 by avibootz
1 answer 293 views
293 views asked Oct 28, 2020 by avibootz
1 answer 279 views
279 views asked Oct 28, 2020 by avibootz
1 answer 286 views
...