fork download
  1. x = int(input());
  2. for j in range(x-1):
  3. for i in range(x-1-j):
  4. print(" ", end="");
  5. for k in range(1+2*j):
  6. print("*", end="");
  7. w = j+2;
  8. print();
  9.  
  10.  
  11.  
  12.  
  13. for q in range(x):
  14. for e in range(x-w+q):
  15. print(" ", end="");
  16. for f in range(1+2*(w-1-q)):
  17. print("*", end="");
  18. print();
  19.  
Runtime error #stdin #stdout #stderr 0.13s 25332KB
stdin
1
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 14, in <module>
NameError: name 'w' is not defined