Quote:
|
Originally Posted by SaturN
The to the power of is straight forward i think
for x in range(1,22)
print x*x But the primary numbers has got me, :p
I was thinking of checking to see if a base number was equal to the number given, if not add another number and check again, but it seems sloppy..
|
You're on the right track. But that actually does squares.
1 x 1
2 x 2
3 x 3.
I asked for:
2 x 2
2 x 2 x 2
2 x 2 x 2 x 2
(Hint: ** does exponent subscript.)