- The
random.randrange(a, b)function, which returns a random numbernin the rangea <= n < b, and therandom.randint(a, b)function, which returns a number in the rangea <= n <= b, have been combined into a single function which takes one argument of type "range" (in 11l the range fora <= n <= bis written asa..b, while the range fora <= n < bis written asa.<b). - The
match()regular expression object method has been replaced byfullmatch()(in other words,fullmatch()in Python corresponds tomatch()in 11l). - The
re.splitandre.subfunctions have been moved from theremodule into the overloaded string methodssplitandreplacerespectively. - The
gettempdir()function from thetempfilemodule and some functions from theosmodule (listdir,walk,mkdir,makedirs,remove,rename, etc.) have been moved to a separatefsmodule; the functions from theos.pathhave been moved tofs:path. - 11l has two modules instead of the
heapqmodule:minheap(equivalent toheapq) andmaxheap, which has no direct equivalent in Python. - The
binandhexfunctions return a string without the0bor0xprefix, because the unprefixed string is more often what is wanted (1, 2, 3, 4, 5, 6, 7, 8, 9). "\n".join(arr)in Python corresponds toarr.join("\n")in 11l (and in 11l the elements ofarrcan be not just strings, as in Python, but any objects for which conversion into a string is defined).map(lambda x: x * 2, filter(lambda x: x % 2 == 0, [1, 2, 3, 4]))in Python corresponds to[1, 2, 3, 4].filter(x -> x % 2 == 0).map(x -> x * 2)in 11l.
Last edited: