A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-May/004090.html below:

[Python-Dev] join() et al.

[Python-Dev] join() et al.Fredrik Lundh Fredrik Lundh" <effbot@telia.com
Tue, 16 May 2000 17:22:06 +0200
>     Marc> join(seq,sep) := reduce(lambda x,y: x + sep + y, seq)
>
> Of course, while it will always yield what you ask for, it might not always
> yield what you expect:
> 
>     >>> seq = [1,2,3]
>     >>> sep = 5
>     >>> reduce(lambda x,y: x + sep + y, seq)
>     16

not to mention:

>>> print join([], " ")
TypeError: reduce of empty sequence with no initial value

...

</F>




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4