- iOS 12 Programming for Beginners
- Craig Clayton
- 109字
- 2021-07-02 15:04:57
Half-closed range
Let's make another constant that is known as a half-closed range and set it equal to 10 < 20. Add the following to Playgrounds:
let halfClosedRange = 10..<20
Your code should now look like this:

A half-closed range is the same as a closed range, except that the end value is not included. In this example, this means that 10 through 19 are included, and 20 will be excluded.
At this point, you will notice that your Results Panel shows you CountableClosedRange(10...20) and CountableRange(10..<20). We cannot see all of the numbers within the range. To see all of the numbers, we need to use a loop.
推薦閱讀
- Cisco OSPF命令與配置手冊(cè)
- RCNP實(shí)驗(yàn)指南:構(gòu)建高級(jí)的路由互聯(lián)網(wǎng)絡(luò)(BARI)
- 計(jì)算機(jī)網(wǎng)絡(luò)安全實(shí)訓(xùn)教程(第二版)
- 面向云平臺(tái)的物聯(lián)網(wǎng)多源異構(gòu)信息融合方法
- 物聯(lián)網(wǎng)之霧:基于霧計(jì)算的智能硬件快速反應(yīng)與安全控制
- 4G小基站系統(tǒng)原理、組網(wǎng)及應(yīng)用
- 物聯(lián)網(wǎng)工程概論
- 深入理解Nginx:模塊開(kāi)發(fā)與架構(gòu)解析
- 設(shè)備監(jiān)控技術(shù)詳解
- 工業(yè)以太網(wǎng)技術(shù):AFDX/TTE網(wǎng)絡(luò)原理、接口、互連與安全
- 物聯(lián)網(wǎng)M2M開(kāi)發(fā)技術(shù):基于無(wú)線CPU-Q26XX
- 物聯(lián)網(wǎng),So Easy!
- 物聯(lián)網(wǎng)概論
- CDN技術(shù)詳解
- Twilio Cookbook(Second Edition)