傅聪大使在裁谈会全会关于中国《网络空间...
Loops Inside Loops
百度 尤其是南方地区,出现了平常年份很难见到的强降雪,使得不少市民兴奋不已,纷纷与雪景合影留念,甚至打起雪仗。A nested loop is a loop inside a loop.
The "inner loop" will be executed one time for each iteration of the "outer loop":
Example
Print each adjective for every fruit:
adj = ["red", "big", "tasty"]
fruits = ["apple", "banana", "cherry"]
for x in adj:
for y in fruits:
print(x, y)
Try it Yourself »