Non conosco nessun linguaggio in cui 42 and 1 == 0

ruby:
irb(main):001:0> 42 && 1
=> 1
irb(main):002:0> 42 and 1
=> 1

clojure:
user=> (and 42 1)
1

lua:
  42 and 1
=> 1

scheme:
  (and 42 1)
=> 1

javascript:
42 && 1
1

anzi no, ci sono delle eccezioni



forth:
   42 1 and
=> 0

in questo caso però non è l'and logico, ma l'and bitwise

se è questo, ciò che cerchi, l'operatore per l'and bitwise in python è "&"

>>> 42 & 1
0


-- 
xmpp: berda...@gmail.com
bitmessage: BM-2cTYXfGiSTsnx3righ6aHcJSWe4MV17jDP
gpg fingerprint: 3F8D53518012716C4EEF7DF67B498306B3BF75A0 (used just
for signing commits)
_______________________________________________
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python

Rispondere a