Kodewick
Start learning →
Starter←→0 / 70

Borrow a book

#015StarterConditions3 min

To borrow from the library you need both: a library card (hasCard) and fewer than 5 books already out (books). Write CanBorrow(hasCard, books) to return true if you can borrow, false if not.

Examples
CanBorrow(true, 2)→True
CanBorrow(false, 0)→False
The functionfunc CanBorrow(hasCard bool, books int) bool
main.go
package main

func CanBorrow(hasCard bool, books int) bool {
	// your code here: has a card and fewer than 5 books? return true
	return false
}
Ctrl + Enter runs too
Result

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