python4---打印长方形

1:方法1
for i in range(6):
for j in range(3):
print("*", end=" ")
print()

2:输入显示长方形
weight = int(input("weight:"))
height = int(input("height:"))
num_height = 1
while num_height <= height:
num_width = 1
while num_width <= weight:
print("*", end="")
num_width += 1
print()
num_height +=1

猜你喜欢

转载自www.cnblogs.com/will--1213/p/11827240.html
今日推荐