Build a Number Pattern Generator - Build a Number Pattern Generator

Tell us what’s happening:

Basically the code isnt passing test 3 even though it is correct or well by the looks of it at least when its in the console. A little bit of help would be nice I feel its a bug but I could be doing it a tiny bit wrong and im just not seeing it.

Your code so far

def number_pattern(n):
    if not isinstance(n, int):
        return 'Argument must be an integer value.'
    if n <= 0: 
        return 'Argument must be an integer greater than 0.'
    result = ' '.join(str(i) for i in range(1, n+1))
    print(result)
        

number_pattern(4)

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36 Edg/151.0.0.0

Challenge Information:

Build a Number Pattern Generator - Build a Number Pattern Generator

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/lab-number-pattern-generator/6842a6cd9836f0114a5b7a8a.md at main · freeCodeCamp/freeCodeCamp · GitHub

is this how you return something from the function?

I got it now I used return instead thanks I might’ve forgot.

Hi,

Was this taught in any of the previous exercises? I did not get to see it or did I miss it?

returning from functions is introduced in https://www.freecodecamp.org/learn/python-v9/lecture-understanding-functions-and-scope/how-do-functions-work-in-python