Add iteration module
This commit is contained in:
12
iteration/iteration.go
Normal file
12
iteration/iteration.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package iteration
|
||||
|
||||
const repeatCount = 5
|
||||
|
||||
func Repeat(character string) string {
|
||||
var repeated string
|
||||
for range repeatCount {
|
||||
repeated = repeated + character
|
||||
}
|
||||
|
||||
return repeated
|
||||
}
|
||||
Reference in New Issue
Block a user