python
while循环
while 语句:
执行语句
结束条件
#应用while输出1到11
counts = 1
while True:
print(“counts:”, counts)
counts = counts +1 #counts +=1
if counts == 11:
break
for 循环
for 变量 in range(起始值,终止值,步长):
循环语句
#从零开始以3为步长不超过10
for i in range(0,10,3)
print(i)
python注释中获得输入信息的几种方式
方法1:
变量1 = input(“A”)
变量2 = input(“B”)
info = ‘’’
C:%s
D:%s
‘’’%(变量1,变量2)
#输入姓名、