当前位置:网站首页>Section 11 of Chapter 1: loop statement while
Section 11 of Chapter 1: loop statement while
2022-07-21 06:23:00 【Zhongyifeng Digital Technology Co., Ltd】
Python Basic introduction ( A full set of nanny level tutorials )
Chapter one
Section 11 : Loop statement while
It can make our code execute repeatedly
while loop :
while Conditions :
Code
The process : Judge whether the condition is true , If it's true , Execute code . Then judge the condition again . … Until the condition is false and the loop ends
Dead cycle
`while True: # Dead cycle
print(" Spray you to death ")
Use the program to count , from 1~100
i = 1
while i <= 100:
print(i)
i = i + 1
1+2+3+4+5+6+7+8+9…+100 = ?
i = 1
s = 0
while i <= 100:
print(i)
print(s) # from 1 To 100 No number of
s = s + i # Add up
i = i + 1
边栏推荐
- LeetCode简单题之滑动窗口的平均值
- 一个短信验证码功能引发的总结思考[通俗易懂]
- UE4(unreal engine4)地形编辑工具中的无法显示样条线
- Excel-vba quick start (VIII. Cell objects - common cell operations)
- ASP.NET Core 6框架揭秘实例演示[01]: 编程初体验
- 数字化转型迈向深水区:银行业不断夯实科技根基
- MySQL indexing principle
- 第二章 第一节:基础数据类型详解
- Implementation of form control adaptation (adaptive form) layout in WinForm_ By C code
- Redis list type
猜你喜欢
随机推荐
[020] [stm32] analysis and application of CAN bus communication protocol
DNA助力破解30年前悬案,嫌疑人或因爱上室友而勒死其女友,被捕时已是科技公司CEO...
Rearrange characters of leetcode simple question to form target string
巴比特 | 元宇宙每日必读:迪拜推出国家元宇宙战略,计划在未来五年内将元宇宙相关公司数量翻 5 倍,支持4万个虚拟工作岗位...
Redis-命令行客户端
Redis introduction
智能隐形眼镜的研究进展与挑战
自定义持久层框架MyORMFramework(二)—框架设计
Abstraction of operational expressions
Redis-String类型
SAP Spartacus 如何根据 page layout 获得对应支持的 slots
第一章 第六节:变量
爱普生发票打印机 每次连续打印发票,都跳页,中间一张空白
幼儿园核酸预约登记小程序实战开发(下篇)
工控安全PLC固件逆向一
第一章第八节:简单了解数据类型
基于二维声子晶体的体声波谐振器仿真分析
C DataGridView data export excel file
【系统设计】分布式键值数据库
Sys_ RMAN backup error