import UIKit
for index in 1..<10
{
index
// index = 3
}
let courseNames = ["玩儿转Swift", "慕课网2048私人定制", "CSS3 3D特效"];
for i in 0..<courseNames.count
{
courseNames[i]
}
截图
0赞 · 0采集
措言
2017-06-07
Range Operator
Closed Range Operator
闭区间 [a, b] a...b
Half-Closed Range Operator
前闭后开区间 [a, b) a..<b
截图
0赞 · 1采集
措言
2017-06-07
Range Operator
截图
0赞 · 0采集
四叶草01234567891011
2016-11-08
区间运算符
截图
0赞 · 0采集
布边的天空
2016-08-26
for-in循环中的索引值是常量
截图
0赞 · 0采集
布边的天空
2016-08-26
区间运算符
截图
0赞 · 0采集
慕标0085627
2016-07-15
闭区间: a...b
前闭后开: a..<b
截图
0赞 · 0采集
imooccodeing
2016-04-21
区间运算符一般会结合for in语法使用
0赞 · 0采集
imooccodeing
2016-04-21
区间运算符
0赞 · 0采集
慕仙3488553
2016-03-08
区间运算符和for_in:
1.闭区间:[a,b] --------- a...b
2.前闭后开区间[a,b) --------- a..<b
3.区间运算符通常和for_in一起使用
4. for index in 1...10{ //循环1到10
index //此时index是10
}
for index in 1..<10{ //循环1到9
index //此时index是9
}
5.Let course = ["swift","ios","css3"]
6.for i in 0..<course.count{ //遍历course这个数组
course[i] //输出了swift,ios,css3
}
0赞 · 0采集
打酱油的二师兄
2016-02-29
foreign循环语法
for [常量] in [区间]
1...10 [1,10] 1-10
1..<10 [1,10) 1-9
0赞 · 0采集
大浓妆掩饰小悲伤
2016-01-02
3-3 区间运算符和for-in循环
知识点1:语法规则
[a,b] --> a...b
[a,b) --> a..<b
知识点2:区间和for-in的结合使用
for index in 1...10{
index
}
以上代码运行10次,用来查看index的值
知识点2: for-in的索引是let类型
0赞 · 0采集
eric晓蔡
2015-12-03
新版已经改了小于是“..<”
0赞 · 0采集
you畅
2015-10-05
For index in 1...10
Index是常量
截图
0赞 · 0采集
胖鸟
2015-10-02
3-3 区间运算符和for-in循环
知识点1:语法规则
[a,b] --> a...b
[a,b) --> a..<b
知识点2:区间和for-in的结合使用
for index in 1...10{
index
}
以上代码运行10次,用来查看index的值
知识点2: for-in的索引是let类型
0赞 · 0采集
noprom
2015-07-02
区间运算符
0赞 · 0采集
永远的零
2015-06-26
区间运算符 Range Operator
[a,b] a...b
[a,b) a..<b
0赞 · 0采集
John_Pan
2015-06-14
数组是从0开始计数,所以会有..<半开区间的使用场景
0赞 · 0采集
DioBrando
2015-05-20
a...b
a..<b
截图
1赞 · 0采集
rihnio
2015-04-18
Range Operator
0赞 · 0采集
慕后端8796626
2015-04-16
[a,b] a...b
[a,b) a..<b
for index in 0..< array.count
{
array[index];
}
截图
0赞 · 0采集
蓝哲007
2015-03-29
[1,10] 1...b
[1,10) 1..<10
0赞 · 1采集
waple_0820
2015-03-24
全闭 1...10 [1,10]
半闭 1..<10 [1,10) 设置如此能在数组中更方便
for i in 中 i 是常量