Kodewick
Start learning →
Starter←→0 / 70

Umbrella or not

#012StarterConditions2 min

The forecast gives the chance of rain as rain (0 to 100). Write Umbrella(rain): return "take it" for 50 or more, otherwise "leave it".

Examples
Umbrella(80)→'take it'
Umbrella(10)→'leave it'
The functionfunc Umbrella(rain int) string
main.go
package main

func Umbrella(rain int) string {
	answer := "leave it"
	// your code here: rain is 50 or more? change answer to "take it"
	return answer
}
Ctrl + Enter runs too
Result

Run tries the examples. When they look right, Submit.