mirror of https://github.com/01-edu/public.git
docs: Add readme file for evenlength subject
This commit is contained in:
parent
402b138983
commit
b974a12074
|
@ -0,0 +1,35 @@
|
|||
## evenlength
|
||||
|
||||
### Instructions
|
||||
|
||||
Write a function that receives a slice of strings and returns a new slice with the strings in which the length is even.
|
||||
|
||||
### Expected function
|
||||
|
||||
```go
|
||||
func EvenLength(strings []string) []string {
|
||||
}
|
||||
```
|
||||
|
||||
### Usage
|
||||
|
||||
Here is a possible program to test your function:
|
||||
|
||||
```go
|
||||
package main
|
||||
import (
|
||||
"piscine"
|
||||
"fmt"
|
||||
)
|
||||
func main() {
|
||||
l := piscine.EvenLength(["Hi", "Hola", "Ola", "Ciao", "Salut", "Hallo"])
|
||||
fmt.Println(l)
|
||||
}
|
||||
```
|
||||
|
||||
And its output:
|
||||
|
||||
```console
|
||||
$ go run .
|
||||
[Hi Hola Ciao]
|
||||
```
|
Loading…
Reference in New Issue