Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- column1 = "number"
- column2 = "squared"
- column3 = "cubed"
- print column1.rjust(20), column2.rjust(20), column3.rjust(20)
- column1 = "------"
- column2 = "-------"
- column3 = "-----"
- print column1.rjust(20), column2.rjust(20), column3.rjust(20)
- print " "
- x = 1
- y = 0
- z = 0
- while (x <= 10):
- y = x * x
- z = x * x * x
- # we will now find the prime numbers and only print prime numbers
- count = 1
- div = 2
- while (div < x):
- if (x % div == 0):
- count = count + 1
- div = div + 1
- if (count == 1):
- print str(x).rjust(20), str(y).rjust(20), str(z).rjust(20)
- x = x + 1
Advertisement
Add Comment
Please, Sign In to add comment