17-1while循环实例
'''
# “ * ”的正方形
i = 0
while i < 5:
j = 0
while j < 5:
if j == 4:
print("*")
else:
print("*", end='')
j += 1
i += 1
'''
'''
# “ * ”的三角形
i = 1
while i <= 5:
j = 0
while j < i:
print("*", end='')
j += 1
print()
i += 1
'''
# 九九乘法表
i = 1
while i <= 9:
j = 1
while j <= i:
print(f'{j}X{i}={j*i}', end='/t')
17-1while循环实例最先出现在Python成神之路。
共有 0 条评论