Having trouble running a query

line = ‘*’
max_length = 10

while len(line) <= max_lenght:
print(line)
line += “*”

while len(line) > 0:
print(line)
line = line[:-1]
while i run this it gives a syntax cant traceback the error

If the code looks like this in your editor, then the obvious problem is indentation.

The error description you’ve provided is so ambiguous, that without a screenshot I’m not sure if anyone knows what could have happened.