Problem of the Day


1. Write a function powers(x) that takes an input x and returns a tuple containing x, x*x, x*x*x, x*x*x*x.  Write a main function that calls powers() on 1, 2, 3, 4, ..., 20, and prints the results in a table as below. Write a main() function that reads an integer from the keyboard and then calls powers() on that integer.

x    x^2    x^3    x^4                             
----------------------------------
1    1        1        1
2    4        8        16
...