2017年9月8日
30秒学会 Python 片段 – sample
Returns a random element from a list. Use random.randint() to generate a random number that correspo...
Returns a random element from a list. Use random.randint() to generate a random number that correspo...
Returns the head of a collection. Use IEnumerable.Count() to check if the enumerable is non-empty. U...
Creates a list of elements, grouped based on the position in the original lists. Use List.generate()...
Randomizes the order of the values of an list, returning a new list. Uses the Fisher-Yates algorithm...
Returns the average value of a list of numbers. Use Iterable.reduce() to get the sum of all the numb...
Returns a list of elements that exist in both lists. Use Iterable.toSet() to get the unique values i...
Returns a flat list of all the values in a flat dictionary. Use dict.values() to return the values i...