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

Hi @danielsmom1250s,

Yes. Your code passes the tests (and I’m going to blur it so it won’t be available to others who haven’t yet worked through this challenge). I honestly don’t know why the test runner keeps running non-stop for you. Maybe try working through these steps to see if any of them help:

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), and set your browser zoom level to 100%. Both of these factors can cause tests to fail erroneously.

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

I hope one of these will work for you.

Happy coding

It did actually end up clearing it once I signed back in! Thank you for your help!

Glad to hear you got it resolved, and thank you for following up with what worked for you!