Build a Number Pattern Generator - Build a Number Pattern Generator

Tell us what’s happening:

Code even runs correctly, but on the test phase, the tests just keep running non-stop and never lets me pass to next lesson

Your code so far

def number_pattern(n):
    
    if type(n) is not int:
        return "Argument must be an integer value."
    
    
    if n < 1:
        return "Argument must be an integer greater than 0."
    
    
    result_parts = []
    for i in range(1, n + 1):
        result_parts.append(str(i))
    
    return " ".join(result_parts)


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

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.5 Safari/605.1.15

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

Please try one of the following steps to move forward.

Click on the “Restart Step” button and force a refresh of your page with CTRL + F5 then try to paste the code in again.

or - Try the step in incognito or private mode.

or - Disable any/all extensions that interface with the freeCodeCamp website (such as Dark Mode, Ad Blockers, or Spellcheckers).

or - Ensure your browser is up-to-date or try a different browser.

I hope one of these will work for you.

even i am about to give exact solution, i hope it will help to sort out the issue.

Instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge. How to Help Someone with Their Code Using the Socratic Method

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.