(test) ? a:b

Jean-Michel Pichavant jeanmichel at sequans.com
Wed Oct 22 10:32:36 CEST 2014


----- Original Message -----
> From: "ast" <nomail at invalid.com>
> To: python-list at python.org
> Sent: Wednesday, 22 October, 2014 10:29:43 AM
> Subject: (test) ? a:b
> 
> Hello
> 
> Is there in Python something like:
> 
> j = (j >= 10) ? 3 : j+1;
> 
> as in C language ?
> 
> thx

j = 3 if j >=10 else j+1

Cheers

JM


-- IMPORTANT NOTICE: 

The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


More information about the Python-list mailing list