- 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.
推薦閱讀
- Application Development with Qt Creator(Second Edition)
- INSTANT PhpStorm Starter
- 物聯網安全與深度學習技術
- Socket.IO Real-time Web Application Development
- Bonita Open Solution 5.x Essentials
- 網管工具使用與技巧大全
- 網絡綜合布線(第2版)
- 組網技術與網絡管理
- 中國互聯網發展報告2021
- Web用戶查詢日志挖掘與應用
- 物聯網與智慧農業
- Python API Development Fundamentals
- 智能物聯網:區塊鏈與霧計算融合應用詳解
- React Design Patterns and Best Practices(Second Edition)
- 通信系統實戰筆記:無處不在的信號處理