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