Re: Printing a Chunk Of Words

2017-09-28 Thread Mark Lawrence via Python-list
On 26/09/2017 01:15, Cai Gengyang wrote: """ Boolean Operators True and True is True True and False is False False and True is False False and False is False True or True is True True or False is True False or True is True False or False is False Not True is False

Re: Printing a Chunk Of Words

2017-09-27 Thread Matt Wheeler
On Wed, 27 Sep 2017 at 14:48 Peter Otten <__pete...@web.de> wrote: > > Reproducing the original string exactly the best I've managed is 260: > > That's a bit long, don't you think, as it can be beaten even by plain old > zipping: > ha! tbh yes It's longer than I was expecting to manage. $ cat bo

Re: Printing a Chunk Of Words

2017-09-27 Thread Thomas Jollans
On 2017-09-27 16:38, Matt Wheeler wrote: > On Wed, 27 Sep 2017 at 13:58 Thomas Jollans wrote: > >>> Reproducing the original string exactly the best I've managed is 260: >>> >>> t,f,a,o,n='True','False','and','or','not' >> >> The Not is capitalized in the original string. >> > > I guess you didn

Re: Printing a Chunk Of Words

2017-09-27 Thread Matt Wheeler
On Wed, 27 Sep 2017 at 13:58 Thomas Jollans wrote: > > Reproducing the original string exactly the best I've managed is 260: > > > > t,f,a,o,n='True','False','and','or','not' > > The Not is capitalized in the original string. > I guess you didn't try it? (or see `upper()` in the body of the `for

Re: Printing a Chunk Of Words

2017-09-27 Thread Peter Otten
Matt Wheeler wrote: > With deepest apologies to all involved... > > On Tue, 26 Sep 2017 at 08:42 Gregory Ewing > wrote: > >> Ben Bacarisse wrote: >> > Think functional! This is 257 characters: >> >> 250 chars, 17 shorter than the text it produces: >> >> a=[];o=[];n=[];A=list.append >> for b in

Re: Printing a Chunk Of Words

2017-09-27 Thread Thomas Jollans
On 2017-09-27 13:51, Matt Wheeler wrote: > With deepest apologies to all involved... > > On Tue, 26 Sep 2017 at 08:42 Gregory Ewing > wrote: > >> Ben Bacarisse wrote: >>> Think functional! This is 257 characters: >> >> 250 chars, 17 shorter than the text it produces: >> >> a=[];o=[];n=[];A=list

Re: Printing a Chunk Of Words

2017-09-27 Thread Matt Wheeler
With deepest apologies to all involved... On Tue, 26 Sep 2017 at 08:42 Gregory Ewing wrote: > Ben Bacarisse wrote: > > Think functional! This is 257 characters: > > 250 chars, 17 shorter than the text it produces: > > a=[];o=[];n=[];A=list.append > for b in range(3,-1,-1): > x=bool(b>>1);y=bo

Re: Printing a Chunk Of Words

2017-09-26 Thread Gregory Ewing
Ben Bacarisse wrote: Think functional! This is 257 characters: 250 chars, 17 shorter than the text it produces: a=[];o=[];n=[];A=list.append for b in range(3,-1,-1): x=bool(b>>1);y=bool(b&1);A(a,"%s and %s is %s"%(x,y,x and y));A(o,"%s or %s is %s"%(x,y,x or y)) if x:A(n,"not %s is %s"%(y

Re: Printing a Chunk Of Words

2017-09-25 Thread Ben Bacarisse
r...@zedat.fu-berlin.de (Stefan Ram) writes: > Cai Gengyang writes: >> Boolean Operators >> >>True and True is True >>True and False is False >>False and True is False >>False and False is False >>True or True is True >>True or False is True >>False or True is Tr

Re: Printing a Chunk Of Words

2017-09-25 Thread Steve D'Aprano
On Tue, 26 Sep 2017 10:15 am, Cai Gengyang wrote: > """ [snip text] > """ > > If I simply want to print a chunk of words and a paragraph like the above, > what command should I use ? Print to the terminal? Use print(). Print to an actual printer? There's no built-in command in Python to do so,

Re: Printing a Chunk Of Words

2017-09-25 Thread Rick Johnson
On Monday, September 25, 2017 at 7:15:41 PM UTC-5, Cai Gengyang wrote: > """ > Boolean Operators > > True and True is True > True and False is False > False and True is False > False and False is False > > True or True is True > True or False is True > False or

Re: Printing a Chunk Of Words

2017-09-25 Thread Chris Angelico
On Tue, Sep 26, 2017 at 10:15 AM, Cai Gengyang wrote: > """ > Boolean Operators > > True and True is True > True and False is False > False and True is False > False and False is False > > True or True is True > True or False is True > False or True is True > False or

Printing a Chunk Of Words

2017-09-25 Thread Cai Gengyang
""" Boolean Operators True and True is True True and False is False False and True is False False and False is False True or True is True True or False is True False or True is True False or False is False Not True is False Not False is True """ If I simply w