[In]
x=0
numbers=[]
while x <6: #当变数大於6中断回圈
print(f"At the top is {x}")
numbers.append(x) #把X增加到串列里面
x=x+1
print("Numbers now:"),numbers
print(f"{x} is at the bottom")
print("The numbers:")
for number in numbers:
print(number)
[Out]
At the top is 0
Numbers now:
1 is at the bottom
The numbers:
At the top is 1
Numbers now:
2 is at the bottom
The numbers:
At the top is 2
Numbers now:
3 is at the bottom
The numbers:
At the top is 3
Numbers now:
4 is at the bottom
The numbers:
At the top is 4
Numbers now:
5 is at the bottom
The numbers:
At the top is 5
Numbers now:
6 is at the bottom
The numbers:
0
1
2
3
4
5
https://ppt.cc/fopYQx
https://ppt.cc/f23jJx
<<: Python侦测VPN网路是否可连线 - Python练习题二
>>: 【左京淳的JAVA WEB学习笔记】第五章 过滤器与监听器
首先我们先将硬体准备完成,需要准备的设备有: 基本设备 Arduino Uno 常见且容易取得的 U...
Vim的思维、哲学与解决问题之道 [系列文目录] 每种工具都有它的设计理念,在接触Vim的前後,我们...
在Vue里有个很大的特色可能就是资料的双向绑定(Two-wayBinding),而资料绑定的话我们最...
阿嬷都看得懂的程序码编辑器与开源软件是什麽 我们终於写出了第一支 .html 与 .css 档案了,...
大眼睛效果 教学原文参考:大眼睛效果 这篇文章会介绍使用 GIMP 的扭曲变换工具,将一般人正常的眼...