Kata of the Day #9

Keep up the hoop

kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
Kata of the Day #9

Alex just got a new hula-hoop, he loves it but feels discouraged because his little brother is better than him.

Write a program where Alex can input (n) how many times the hoop goes round, and it will return him an encouraging message :)

  • If Alex gets 10 or more hoops, return the string "Great, now move on to tricks".
  • If he doesn't get 10 hoops, return the string "Keep at it until you get it".

TypeScript


function hoopCount(n: number): string {
    return n >= 10 ? "Great, now move on to tricks" : "Keep at it until you get it";
}

Go


func hoopCount(n int) string {
    if n >= 10 {
        return "Great, now move on to tricks"
    } else {
        return "Keep at it until you get it"
    }
}

Python


def hoop_count(n):
    return "Great, now move on to tricks" if n >= 10 else "Keep at it until you get it"

PHP


function hoopCount($n) {
    return $n >= 10 ? "Great, now move on to tricks" : "Keep at it until you get it";
}

Go to Kata
ByCesar Kohl

Need some help?

Want us to give you some help with your business? No problem, here's a video on who we can help, and how, along with our calendar so you can book in a call to discuss us working together.

Let's see
budget
budget
budget
budget
budget
budget
budget
budget
budget
budget

Subscribe to our newsletter

subscribe
subscribe
subscribe
subscribe
subscribe
subscribe
subscribe
subscribe
subscribe
subscribe