(test) ? a:b

buscacio at gmail.com buscacio at gmail.com
Wed Oct 22 11:05:25 CEST 2014


Em quarta-feira, 22 de outubro de 2014 06h29min55s UTC-2, ast  escreveu:
> Hello
> 
> 
> 
> Is there in Python something like:
> 
> 
> 
> j = (j >= 10) ? 3 : j+1;
> 
> 
> 
> as in C language ?
> 
> 
> 
> thx

without not:
j = [j+1, 3][j>=10]
with not:
j = [3, j+1][not (j>=10)]




More information about the Python-list mailing list