compound statement from C "<test>?<true-val>:<false-val>"

Holger ishoej at gmail.com
Fri Feb 2 07:01:14 EST 2007


Hi

I have not been able to figure out how to do compound statement from C
- "<test>?<true-val>:<false-val>"

But something similar must exist...?!

I would like to do the equivalent if python of the C line:
printf("I saw %d car%s\n", n, n != 1 ? "s" : "")

Please help

/Holger




More information about the Python-list mailing list