Problems with Python Interactive Window Visual Studio Code

Viewed 130

I was solving an exercise in python using Visual Studio Code, to creat a triangle with asterisks:

h = int(input('Introduce el nro de líneas para el triángulo isósceles:'))

for i in range(h):
    espacios = h - i
    asteriscos = 2 * i + 1
    print(' ' * espacios + '*' * asteriscos)

But, when I run in Python Interactive Window, there is a problem: first line printed not considered spaces:

Problem in Python interactive window

This same code in Jupyter Notebook or Spyder works fine.

0 Answers
Related