fork download
  1. rows = 5
  2. i = 0
  3. while i <= rows - 1:
  4. j = 0
  5. while j < i:
  6. print('', end=' ')
  7. j += 1
  8. k = i
  9. while k <= rows - 1:
  10. print('*', end=' ')
  11. k += 1
  12. print()
  13. i += 1
  14.  
  15. i = rows - 1
  16. while i >= 0:
  17. j = 0
  18. while j < i:
  19. print('', end=' ')
  20. j += 1
  21. k = i
  22. while k <= rows - 1:
  23. print('*', end=' ')
  24. k += 1
  25. print('')
  26. i -= 1
Success #stdin #stdout 0.03s 9584KB
stdin
Standard input is empty
stdout
* * * * * 
 * * * * 
  * * * 
   * * 
    * 
    * 
   * * 
  * * * 
 * * * * 
* * * * *