Swift3.0 元组 (tuples)

//元组
//不需要的元素用 _ 标记
let (name,age,_) = ("明明","10","")
print(name,age)

//通过下标访问特定的元素
let student = ("明明","10","")

print(student.0,student.1,student.2)

let bobo = (name:"波波",age:"24")
print(bobo.name,bobo.age)

 

posted @ 2016-12-12 11:45  会钓鱼的丶猫  阅读(925)  评论(0编辑  收藏  举报