"""用*号打印三角形""" for x in range(-10,11): print('*' * (10-abs(x))) """用*号打印正弦曲线""" from math import * # 从数学模块导入所有命令 for x in range(0,180): y = int(80 * sin(radians(x))) # radians把弧度值转为角度值 print('*' * y) """用*号打印周期性三角形""" for x in range(0,60): print('*' * (20-abs(x%20)))