View Single Post
Old Apr 13th, 2005, 9:56 PM   #8
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,827
Rep Power: 5 Sane will become famous soon enough
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.)
Sane is offline   Reply With Quote