''' Purpose: demonstrate int and float numeric input processing ''' # get inputs # Remember that user input is stored as a string in the variable set = to the input statement! # The first user input will be stored as a string in x_reply # The second user input will be stored as a string in n_reply x_reply = input( 'Enter base (integer): ' ) n_reply = input( 'Enter exponent (decimal): ' ) print() # convert inputs to numerics - we can't do exponentiation with strings of numbers ^ # Convert the strings to numbers so we can do calculations! x = int( x_reply ) # cast string x_reply to get an int n = float( n_reply ) # cast string n_reply to get a decimal # compute x to the nth power value = x ** n # This is exponentiation so it does x ^ n (ex. 3**2 = 3^2 = 9) # display result print( value ) # print(x**n) also works (since value stores x**n) - We just typically don't prefer to do calculations in print statements # in this class!