# -*- coding: utf-8 -*-
__author__ = 'manman'

"""
根据用户输入打印正三角，比如用户输入3打印如下：

*

 *
* *

  *
 * *
* * *

打印菱形


"""


# 1. 三角形
# def show_triangle(num):
#     """
#     print triangle
#     :param num:
#     :return:
#     """
#     for i in range(num):
#         # print('i%s' % i)
#         print(' ' * (num - i - 1), end='')
#         for j in range(i + 1):
#             print('*', end=' ')
#         print()
#
# if __name__ == '__main__':
#     num = int(input('Please input the number:'))
#     show_triangle(num)


# 2. 菱形
def show_diamond(num):
    """
    print diamond
    :param num:
    :return:
    """
    # 菱形的上半部分
    for i in range(num):
        print(' ' * (num - i) + '*' * (2 * i + 1))
    # 菱形的正中
    print('*' * (2 * num + 1))
    # 菱形的下半部分
    for i in range(num):
        print(' ' * (i + 1) + '*' * (2 * (num - i - 1) + 1))



if __name__ == '__main__':
    num = int(input('Please input the number:'))
    show_diamond(num)
