golang-exercises/golangr/between-1-10-checker/compare.go

14 lines
283 B
Go
Raw Normal View History

package main
import "fmt"
// TODO: Figure out error handling and prevent people from breaking this
func compare(number float64) {
if number >= 1 && number <= 10 {
fmt.Printf("%v is between 1 and 10\n", number)
} else {
fmt.Printf("%v isn't between 1 and 10\n", number)
}
}