Login and get coding
Let's get some more practice with decorators ... in this Bite you will write a decorator that checks if input arguments (
*args) are positive integers.
You would use
*argswhen you're not sure how many arguments might be passed to your function, i.e. it allows you pass an arbitrary number of arguments to your function (source).
If one or more of the passed in args are not of type
int, it throws a
TypeError, if it is an
intbut < 0, it throws a
That's it! Wrap it in a nice decorator and the tests will validate your code. Have fun!