ot a "super xor" (commonly known as XOR). Rather than
describing xor as:
check if exactly one element of two elements is true
describe it as:
check if an odd number of two elements is true
then you'll get the correct definition of "super xor":
chec
es on the observation that subtracting an integer
value from 0x gives the same result as XOR-ing that same value
to 0x."
And, perhaps the most useful use of all, for Bouton's solution of the
game of Nim--both for the proof that his strategy "solves" the game
and for an easy implementation of a Nim-playing program--and the only
operator needed is XOR (e.g., http://www.wordiq.com/definition/Nim).
wayne
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 15 Jul 2009 11:51:44 -0700 (PDT), Mark Dickinson
wrote:
>On Jul 15, 7:29 pm, Wayne Brehaut wrote:
>> On Tue, 14 Jul 2009 11:47:41 -0700 (PDT), Mark Dickinson
>> wrote:
>> >I'd also guess that 'xor' would be much less used than 'and' o
,
>>> 'civet'])
>>> nasty = set(['doggy-doo', 'polecat', 'limburger', 'Perl'])
>>> cheese & stinky # stinky cheese
set(['limburger', 'stilton'])
>>> cheese ^ stinky # either cheese or stinky but not both
set(['doggy-doo', 'civet', 'polecat', 'skunk', 'cheddar'])
>>> cheese ^ stinky ^ nasty # in an odd number of these sets (1 or 3)
set(['civet', 'cheddar', 'Perl', 'limburger', 'skunk'])
wayne
--
http://mail.python.org/mailman/listinfo/python-list
imburger', 'Perl'])
>>> cheese & stinky # stinky cheese
set(['limburger', 'stilton'])
>>> cheese ^ stinky # either cheese or stinky but not both
set(['doggy-doo', 'civet', 'polecat', 'skunk', 'cheddar'])
>>> cheese ^ stinky ^ nasty # in an odd number of these sets (1 or 3)
set(['civet', 'cheddar', 'Perl', 'limburger', 'skunk'])
Who hasn't needed that occasionally?
wayne
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 09 Sep 2010 18:26:52 -0400, Dave Angel wrote:
> On 2:59 PM, Baba wrote:
>> Hi
>>
>> In below code "the outer loop test in step 4 will execute ( n + 1 )
>> times (note that an extra step is required to terminate the for loop,
>> hence n + 1 and not n executions), which will consume T4( n
On Mon, 27 Sep 2010 20:57:09 -0700 (PDT), Peter
wrote:
>On Sep 28, 12:31 pm, Steven D'Aprano t...@cybersource.com.au> wrote:
>> On Mon, 27 Sep 2010 15:28:34 -0700, Eduardo Ribeiro wrote:
>> > But it doesn't work.
>>
>> What do you mean "doesn't work"?
>>
>> - It crashes the operating system;
>> -
On Mon, 27 Sep 2010 12:45:44 -0400, Andreas Waldenburger
wrote:
>On Mon, 27 Sep 2010 17:48:06 +0200 Marco Gallotta
> wrote:
>
>> Since these are kids, we feel the nice changes in 3 such as removing
>> integer division will help in teaching. It will also remove confusion
>> when they go to downloa
>
> Thinking object-orientedly, my first idea was to use an object as a
> decorator:
>
> class CallCounter:
> def __init__(self, decorated):
> self.__function = decorated
> self.__numCalls = 0
>
> def __call__(self, *args, **kwargs):
> self.__numCalls += 1
> return self.__fun
appreciated.
Wayne
--
http://mail.python.org/mailman/listinfo/python-list
t.valuelist.append([])
else:
# The rest of the data
mydict.valuelist.append(word)
for key, value in mydict.iteritems():
print key, value
if __name__ == '__main__':
readfile()
### End of code ###
Cheers,
Wayne
--
http://mail.python.org/mailman/listinfo/python-list
Thank you
It just highlights that when your tired things can easily be missed and
maybe you should leave things until the morning to view things with
fresh eyes =)
--
http://mail.python.org/mailman/listinfo/python-list
On 12/11/2022 10:01, Stefan Ram wrote:
> Many readers here know interactive Python sessions with
> prompts like ">>>". But a "session" could be something else.
> One could imagine that when starting a new session, one
> still sees all the variables and constants defined in
> preceding s
101 - 113 of 113 matches
Mail list logo