Pour emprunter à la bibliothèque, il te faut les deux : une carte (hasCard) et moins de 5 livres déjà empruntés (books). Écris CanBorrow(hasCard, books) pour renvoyer true si tu peux emprunter, false sinon.
CanBorrow(true, 2)→TrueCanBorrow(false, 0)→Falsefunc CanBorrow(hasCard bool, books int) boolpackage main
func CanBorrow(hasCard bool, books int) bool {
// ton code ici: une carte et moins de 5 livres? renvoie true
return false
}
Exécuter teste les exemples. Quand ils sont bons, appuie sur Envoyer.