''' Purpose: demonstrate int and float numeric input processing ''' print() # get inputs x = input( 'Enter base (integer): ' ) # right now, x is a string n = input( 'Enter exponent (decimal): ' ) # right now, n is a string print() # convert inputs to numerics x = int( x ) # so we have the int() function; this line gets the string x, # converts it into an int, and stores the new value in the variable x # so we've cast x from a string to an int # '11 12' cannot be converted into one number; int() only works with one value at a time n = float( n ) # compute x to the nth power value = x ** n # ** does exponentiation # display results print( x, 'to power', n, 'equals', value ) # feel free to play with input to see how Python treats the input when it comes to casting (changing the data type)