mirror of https://github.com/01-edu/public.git
docs: Explain what to do when slice is empty or there are no even elements as per review
docs: remove piscine imports and refactor to remove variable as per review
This commit is contained in:
parent
aab618949e
commit
5ab429e996
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
### Instructions
|
### Instructions
|
||||||
|
|
||||||
Write a function that receives a slice of strings and returns a new slice with the strings in which the length is even.
|
Write a function that receives a slice of strings and returns a new slice with the strings in which the length is even. When the slice is empty or there are no even strings return an empty slice.
|
||||||
|
|
||||||
### Expected function
|
### Expected function
|
||||||
|
|
||||||
|
@ -17,13 +17,11 @@ Here is a possible program to test your function:
|
||||||
|
|
||||||
```go
|
```go
|
||||||
package main
|
package main
|
||||||
import (
|
|
||||||
"piscine"
|
import "fmt"
|
||||||
"fmt"
|
|
||||||
)
|
|
||||||
func main() {
|
func main() {
|
||||||
l := piscine.EvenLength([]string{"Hi", "Hola", "Ola", "Ciao", "Salut", "Hallo"})
|
fmt.Println(EvenLength([]string{"Hi", "Hola", "Ola", "Ciao", "Salut", "Hallo"}))
|
||||||
fmt.Println(l)
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue