Tuple可以作为集合存储不同类型的数据,初始化实例如下: val tuple = (1,3,3.14,"aa") val third = tuple._3 Tuple 下标访问从1开始, 需要用下划线. Scala函数还可以返回Tuple类型的值,并接收,如: val (first,second,third,forth) = tuple 跟Tuple无关但是挺有意思的东西,顺便写在这里: zip方法,(拉链操作) val pa = Array(1,2,3) //&
a = 'python' print('hello,', a or 'world') b = '' print ('hello,', b or 'world') print('-----------------------------------') 创建list L = ['Adam',95.5,'Lisa',85,'Bart',59] print('创建list:',L) print('-----------------------------------') #按照索引访问list pri