MIT 6.0001 ps0
Assignment:
Write a program that does the following in order:
- Asks the user to enter a number “x”
- Asks the user to enter a number “y”
- Prints out number “x”, raised to the power “y”.
- Prints out the log (base 2) of “x”.
import math
# import numpy as np
x = int(input('Enter number x:'))
y = int(input('Enter number y:'))
print('X**y = %d' % (x**y))
print('log(x)=%d' % (math.log(x,2)))
# print('log(x)=%d' % np.log2(x))