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
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.