import random outcomes = {'heads':0, 'tails':0} sides = outcomes.keys() print(sides[0]) 会产生错误:TypeError: 'dict_keys' object does not support indexing 这是由于python3改变了dict.keys,返回的是dict_keys对象,支持i
一维数组的使用极其常用操作: 访问,排序,去重 eg: awk 'BEGIN{info="it is a test aha ha ha ha. test over"; lens=split(info,tA," ");#splitprint "len of Arr:" print length(tA),lens; print asort(tA);#sort ,return le