Advertisement
PowerCell46

Diamond Python

Feb 3rd, 2023
763
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. input_number = int(input())
  2.  
  3. start_list = [" "]
  4. normal_list = []
  5.  
  6. for i in range(((input_number) -1), -1, -1):
  7.     start_list.append("*")
  8.     start_list.append(" ")
  9.  
  10. normal_list.append("".join(start_list))
  11.  
  12. for i in range(((input_number -2)), -1, -1):
  13.     if "*" in start_list:
  14.         index_1 = start_list.index("*")
  15.         start_list.pop(index_1)
  16.     start_list.append(" ")
  17.     normal_list.append("".join(start_list))
  18.  
  19. for i in range(len(normal_list) -1, -1, -1):
  20.     print(normal_list[i])
  21.  
  22. for i in range(1, len(normal_list),):
  23.     print(normal_list[i])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement