1.引入包中的全部方法 import math._ //引入包中所有方法,与java中的*类似 2.表示集合元素 val a = (1 to 10).filter(_%2==0).map(_*2) //表示集合元素 for(i <- a) println(i) 表示集合元素的元素内容,并进行计算 3.表示元组内容 val t = Tuple2(1,2) println(t._1) //打印元组内容 4.模糊匹配 val value = a //模糊匹配 val result = value ma…
Underscores in Python https://shahriar.svbtle.com/underscores-in-python Underscores in Python This post discusses the use of the _ character in Python. Like with many things in Python, we’ll see that different usages of _ are mostly (not always!) a m…