>>> hello(2, "Hello World") 'Hello WorldHello World' n must be an integer >>> hello("Hey", "Hello ") Traceback (most recent call last): ... TypeError: n must be integer By default it repeat "Hello " for n times >>> hello(3) 'Hello Hello Hello ' """ if not isinstance(n, int): raise TypeError("n must be integer") return n * greeting if __name__ == "__main__": import doctest doctest.testmod() Tuesday, 23 October, 12