Build a Number Pattern Generator - Build a Number Pattern Generator

Tell us what’s happening:

Why does my code does not pass the test although all the requirements are met, or so I think.

Your code so far

def number_pattern(n): 
    num_string = ''
    if not isinstance(n,int):
        print('Argument must be an integer value.')
    elif n<1:
        print('Argument must be an integer greater than 0.')
    else:
        for num in list(range(n)):
            num += 1
            num_string += str(num) + ' '
    print(num_string.strip())

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.1 Safari/605.1.15

Challenge Information:

Build a Number Pattern Generator - Build a Number Pattern Generator

What number_pattern function returns?

sorry I don’t really understand your question. could you reiterate

If function returns something, then the result can be used later, ie. by different function. In python functions always return something, but if there’s no explicit return inside of the function then implicitly is returned None.

You can check if function returns anything ie. with following code:

print('Result: ', number_pattern(10))

Put a different way: If you check all of the user stories, it never says to use print()

Thank you guys :folded_hands: I fixed it