Skip to content

Latest commit

 

History

History
44 lines (24 loc) · 772 Bytes

Count_the_Monkeys.md

File metadata and controls

44 lines (24 loc) · 772 Bytes

CodeWars Python Solutions


Count the Monkeys!

You take your son to the forest to see the monkeys. You know that there are a certain number there (n), but your son is too young to just appreciate the full number, he has to start counting them from 1.

As a good parent, you will sit and count with him. Given the number (n), populate an array with all numbers up to and including that number, but excluding zero.

Example

monkeyCount(10) # --> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
monkeyCount(1) # --> [1]

Given Code

def monkey_count(n):
    pass

Solution

def monkey_count(n):
    return list(range(1, n+1))

See on CodeWars.com