Python编程-while循环

while循环格式: 练习1:输出三次hello python 1.程序内容为: #1.定义一个整数变量,记录循环的次数 i = 1 #2.开始循环 while i <= 3: #希望循环内执行的代码 print('hello python') #处理计数器 i += 1 运行该程序 练习2:求1~100所有奇,偶数之和 1.程序内容为: i=0 a=0 b=0 while i <
相关文章
相关标签/搜索