Programming Course for Beginners - ZedLX

The Easiest Online Computer Programming Course, for Free

Nested Loops and Alignment [4/10]

We would also like the output to be aligned so that it looks like a table. Can you add the alignment?

Hint:

Type int has a getter function for aligning the output. This getter function returns a value of type string. To apply a getter function on an expression, put the expression inside parenthesis.

Solution:

: print (j*i).pad(3)," ";

Loading...