import functools
sorted_ignore_case = functools.partial(sorted,key=str.lower)
print sorted_ignore_case(['bob', 'about', 'Zoo', 'Credit'])
sorted_ignore_case = functools.partial(sorted,key=str.lower)
print sorted_ignore_case(['bob', 'about', 'Zoo', 'Credit'])
2015-12-11
import math
def is_sqr(x):
return math.sqrt(x)%1.0==0
print filter(is_sqr, range(1, 101))
def is_sqr(x):
return math.sqrt(x)%1.0==0
print filter(is_sqr, range(1, 101))
2015-12-08