Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- def diamond(x):
- i = 1
- while i < x + 1:
- string = (" " * (x - i) + "* " * i).rstrip()
- print(string)
- i = i + 1
- i = i - 2
- while i > 0:
- string = (" " * (x - i) + "* " * i).rstrip()
- print(string)
- i = i - 1
- def main():
- x = int(sys.argv[1])
- diamond(x)
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement