Quantcast

Jump to content


Photo

Python Help


  • Please log in to reply
2 replies to this topic

#1 WhiteRabbit

WhiteRabbit
  • 86 posts

Posted 24 June 2010 - 07:34 PM

Does python have an or operator like c has

if arg==1 || arg==-15

does python have anything like that or is there a good way to do it?

#2 ShadowLink64

ShadowLink64
  • 16735 posts


Users Awards

Posted 24 June 2010 - 07:44 PM

Literally just type "or":
>>> arg = 1
>>> arg == 1 or arg==-15
True
>>> arg = 0
>>> arg == 1 or arg==-15
False


#3 WhiteRabbit

WhiteRabbit
  • 86 posts

Posted 24 June 2010 - 07:48 PM

Thanks much shadowlink!


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users