fork download
  1. def triangle(n):
  2. k = 2*n - 2
  3. for i in range(0, n):
  4. for j in range(0, k):
  5. print(end=" ")
  6. k = k - 1
  7. for j in range(0, i+1):
  8. print("%10.5d,b[j] ", end="")
  9. j=j+1
  10. print("\r")
  11. a=2
  12. b=[]
  13. for i in range(0,k+1):
  14. for j in range(0,k+1):
  15. b+=[a*(2*a-1)]
  16. a=a+2
  17. n=int(input())
  18. triangle(n)
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
2
compilation info
Traceback (most recent call last):
  File "/usr/lib/python3.5/py_compile.py", line 125, in compile
    _optimize=optimize)
  File "<frozen importlib._bootstrap_external>", line 735, in source_to_code
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "./prog.py", line 1
    def triangle(n):
    ^
IndentationError: unexpected indent

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.5/py_compile.py", line 129, in compile
    raise py_exc
py_compile.PyCompileError: Sorry: IndentationError: unexpected indent (prog.py, line 1)
stdout
Standard output is empty