Q:

def python error repeat

Although I'm entering a numerical value, it's still giving me an error. I dont know why this is happening.. help someone?
def is_string(s):
    rate = input(s)
    try:
        str.isalpha(rate)
        print('There was an error. Please try again. Make sure you use numerical values and alpabetical. ')
        return is_string(s)  #ask for input again
   except:
        return rate
ExRate = is_string('Please enter the exchange rate in the order of, 1 '+Currency1+' = '+Currency2)

def is_string2(msg):
    amount = input(msg)
    try:
        str.isalpha(amount)
        print('There was an error. Please try again. Make sure you use numerical values. ')
        return is_string2(msg)  #ask for input again
    except:
        return amount
Amount = is_string2('Please enter the amount you would like to convert:')

A:

Are you looking for something like this?
def get_int(prompt, error_msg):
    while True:
        try:
            return int(input(prompt))
        except ValueError:
            print(error_msg)

rate = get_int(
    'Please enter the exchange rate in the order of, 1 {} = {}'
        .format(Currency1, Currency2),
    error_msg="Rate must be an integer")
amount = get_int(
    'Please enter the amount you would like to convert:',
    error_msg="Amount must be an integer")

