python循环

来源:互联网 发布:openwrt 网络共享 编辑:程序博客网 时间:2024/05/16 09:32
i = 10while i> 0:    print("hello word")    print(i)    i=i-1

创建一个变量名为i 并给他赋值为10

然后创建一个while循环 如果i>0那么就打印hello word 和输出i的当前值 并且每次i递减