- Swift Functional Programming(Second Edition)
- Dr. Fatih Nayebi
- 82字
- 2021-07-02 23:54:26
while loops
Swift provides while and repeat-while loops. A while or repeat-while loop performs a set of expressions until a condition becomes false. Consider the following example:
var n = 2
while n < 100 {
n = n * 2
}
var m = 2
repeat {
m = m * 2
} while m < 100
The while loop evaluates its condition at the beginning of each iteration. The repeat-while loop evaluates its condition at the end of each iteration.
推薦閱讀
- Python數(shù)據(jù)分析與挖掘?qū)崙?zhàn)
- 使用GitOps實現(xiàn)Kubernetes的持續(xù)部署:模式、流程及工具
- 從0到1:數(shù)據(jù)分析師養(yǎng)成寶典
- 軟件成本度量國家標(biāo)準(zhǔn)實施指南:理論、方法與實踐
- 大數(shù)據(jù)Hadoop 3.X分布式處理實戰(zhàn)
- Starling Game Development Essentials
- ZeroMQ
- 金融商業(yè)算法建模:基于Python和SAS
- Oracle PL/SQL實例精解(原書第5版)
- Splunk智能運(yùn)維實戰(zhàn)
- 淘寶、天貓電商數(shù)據(jù)分析與挖掘?qū)崙?zhàn)(第2版)
- 大數(shù)據(jù)數(shù)學(xué)基礎(chǔ)(Python語言描述)
- 企業(yè)主數(shù)據(jù)管理實務(wù)
- 中文版Access 2007實例與操作
- 活用數(shù)據(jù):驅(qū)動業(yè)務(wù)的數(shù)據(jù)分析實戰(zhàn)