i = 1while i <= 5:result = 1while result <= i:
print("*", end="")
result += 1print("第 %d 行" % i)print("")
i += 11.为什么方框里 嵌套的while (result) 循环, 它的变量每次都是从1开始?2.而while (i)循环 每次只判断一次? 即从 i += 1后的累加值?刚开始学python, 这里有点蒙, 恳求大家能指点一下, 先多谢了.i 和 result1 1<=12 1<=2, 2<=23 1<=3, 2<=3, 3<=3, 4 1<=4, 2<=4, 3<=4, 4<=4, 5 1<=5, 2<=5, 3<=5, 4<=5, 5<=5关注 | 3收藏
添加回答
举报
0/150
提交
取消