I am fairly familiar with C, but new to Python. Does Python have something like the handy C conditional expression? For example:
// C conditional expression x = a ? b : c;
// if a is true then x = b else x = c
// here used to print 10 numbers in each row
// the numbers are separated by tabs, each row ends with a '\n'
#include <stdio.h>
int main()
{
int k;
for(k = 0; k < 100; k++)
{
printf("%3d%c", k, (k % 10 == 9) ? '\n' : '\t');
}
getchar(); // make the console wait
return 0;
}