- The
random.randrange(a, b)
function, which returns a random numbern
in 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 <= b
is written asa..b
, while the range fora <= n < b
is 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.split
andre.sub
functions have been moved from there
module into the overloaded string methodssplit
andreplace
respectively. - The
gettempdir()
function from thetempfile
module and some functions from theos
module (listdir
,walk
,mkdir
,makedirs
,remove
,rename
, etc.) have been moved to a separatefs
module; the functions from theos.path
have been moved tofs:path
. - 11l has two modules instead of the
heapq
module:minheap
(equivalent toheapq
) andmaxheap
, which has no direct equivalent in Python. - The
bin
andhex
functions return a string without the0b
or0x
prefix, 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 ofarr
can 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: