def historical_wealth_calculator(amount, currency, year, month, day):
    """
    This function calculates the value in US dollars of a certain "amount" (of a given "currency") on a specific date
    (identified by the parameters year, month and day)
    For instance, historical_wealth_calculator(145, "GBP", "2016", "06", "15") should return the value in USD of 145 GBP
     on June 15 2016     (The answer is 394.66...)
    Note that, given the data that you are provided, "GBP" and "JPY" are the only possible currencies
    (and your program should raise an error if a different currency is requested)
    """
    if currency == "GBP":
        file = open("GBP2USD.txt", "r")
        for line in file:
            date = line.split('\t')
            if date[0] == year + '-' + month + '-' + day:
                return float(date[1])*amount
        print("No data for " + year + '-' + month + '-' + day)
    elif currency == "JPY":
        file = open("JPY2USD.txt", "r")
        for line in file:
            date = line.split('\t')
            if date[0] == year + '-' + month + '-' + day:
                return float(date[1]) * amount
        print("No data for " + year + '-' + month + '-' + day)
    else:
        print("Wrong Currency")