Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. import sys
  2.  
  3. def diamond(x):
  4. i = 1
  5. while i < x + 1:
  6. string = (" " * (x - i) + "* " * i).rstrip()
  7. print(string)
  8. i = i + 1
  9. i = i - 2
  10. while i > 0:
  11. string = (" " * (x - i) + "* " * i).rstrip()
  12. print(string)
  13. i = i - 1
  14.  
  15. def main():
  16. x = int(sys.argv[1])
  17. diamond(x)
  18.  
  19. if __name__ == '__main__':
  20. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement