Build a Number Pattern Generator - Build a Number Pattern Generator

Tell us what’s happening:

Hi again,
I think I made a mistake somewhere, I tried retyping the code agazin and again and tried to change a few things like indentation and syntax.
Could someone explain to me what I did wrong ? Or what I haven’t done ?

Your code so far

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

print(number_pattern(4))
print(number_pattern(12))

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36 Edg/149.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

Hi @Cladvyr,

Should your number string end with a space?

The last two returns will never be reached, not to mention the fact that you are trying to return a function call, which should be printed as you’ve done below the function.

Happy coding

code removed by moderator

Welcome to the forum @manasip2006

You can post solutions that invite discussion (like asking how the solution works, or asking about certain parts of the solution). But please don’t just post your solution for the sake of sharing it.
If you post a full passing solution to a challenge and have questions about it, please surround it with [spoiler] and [/spoiler] tags on the line above and below your solution code.

Happy coding