Skip to content

Commit 4dda0c8

Browse files
miss-islingtonmatheusja
authored andcommitted
gh-97709: Included newline separator in Mandelbrot set (GH-97737)
Included newline separator in Mandelbrot set Now the Mandelbrot set one-liner example on separates the lines with a '\n' character. (cherry picked from commit 4980260) Co-authored-by: matheusja <[email protected]>
1 parent 746fb3c commit 4dda0c8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doc/faq/programming.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ Is it possible to write obfuscated one-liners in Python?
735735
--------------------------------------------------------
736736

737737
Yes. Usually this is done by nesting :keyword:`lambda` within
738-
:keyword:`!lambda`. See the following three examples, due to Ulf Bartelt::
738+
:keyword:`!lambda`. See the following three examples, slightly adapted from Ulf Bartelt::
739739

740740
from functools import reduce
741741

@@ -748,7 +748,7 @@ Yes. Usually this is done by nesting :keyword:`lambda` within
748748
f(x,f), range(10))))
749749

750750
# Mandelbrot set
751-
print((lambda Ru,Ro,Iu,Io,IM,Sx,Sy:reduce(lambda x,y:x+y,map(lambda y,
751+
print((lambda Ru,Ro,Iu,Io,IM,Sx,Sy:reduce(lambda x,y:x+'\n'+y,map(lambda y,
752752
Iu=Iu,Io=Io,Ru=Ru,Ro=Ro,Sy=Sy,L=lambda yc,Iu=Iu,Io=Io,Ru=Ru,Ro=Ro,i=IM,
753753
Sx=Sx,Sy=Sy:reduce(lambda x,y:x+y,map(lambda x,xc=Ru,yc=yc,Ru=Ru,Ro=Ro,
754754
i=i,Sx=Sx,F=lambda xc,yc,x,y,k,f=lambda xc,yc,x,y,k,f:(k<=0)or (x*x+y*y

0 commit comments

Comments
 (0)