""" Purpose: demonstrate int and float numeric input processing """ # Get inputs x_reply = input( "Enter base (integer): " ) # variables named according to problem n_reply = input( "Enter exponent (decimal): " ) # definition # always end your prompts with a space!! # x_reply and n_reply are strings, because input always gives a string back # if there's 1 input, naming it reply1 is confusing - only number when you have # multiple replies print() # print a blank line # Convert inputs to numerics x = int( x_reply ) # Cast string x_reply to get an int n = float( n_reply ) # Cast string n_reply to get a decimal # casting is computer science for changing type # using float() to convert x would be approximately the same, but we don't know # based on how numbers are stored in computers # Compute x to the nth power value = x ** n # not x^n in most programming languages # Display result print( value )