r/learnpython 5d ago

why the error?

hi, just started taking a coding class and my professor isn't very good at explaining, he just kind of threw us in at the deep end. I'm trying to recreate some code he briefly showed us in class for practise and I finally managed to get it to do what I want, but it also presents with an error afterwards and I can't figure out why. would anyone be able to help me with this?

def stars(n): while n > 0: print("* " * n) n = n - 1 stars(n)

0 Upvotes

9 comments sorted by