# coding=utf-8"""打印出如下图案(菱形): * *** ************ ***** *** *""" from sys import stdout for i in range(4): for j in range(2 - i + 1): stdout.write(‘ ‘) for k in range(2 * i + 1): stdout.write(‘*‘) print("") for i in range(3): for j in range(i + 1): stdout.write(‘ ‘) for k in range(4 - 2 * i + 1): stdout.write(‘*‘) print("")
原文地址:https://www.cnblogs.com/walxt/p/11565867.html
时间: 2024-10-14 20:34:51