-5
下面是代碼:For循環蟒紋不同
start = 1
end = 3
a = "one"
b = "two"
for x in range(start, end + 1):
print a
print b
print b
print b
輸出:
one
two
two
two
one
two
two
two
one
two
two
two
所需的輸出:
one
two
two
two
two
one
one
one
one
two
two
two
有人請幫助我獲得所需的輸出
第一時間打印一張,followe d三次b,第二次打印b,接着三次a,第三次打印a,接着三次b等等
正確的答案,另一個可能的建議是用循環改變重複的「打印b」。 –