def build_plot_values(gdpinfo, gdpdata):
    """
    Inputs:
      gdpinfo - GDP data information dictionary
      gdpdata - A single country's GDP stored in a dictionary whose
                keys are strings indicating a year and whose values
                are strings indicating the country's corresponding GDP
                for that year.

    Output: 
      Returns a list of tuples of the form (year, GDP) for the years
      between "min_year" and "max_year", inclusive, from gdpinfo that
      exist in gdpdata.  The year will be an integer and the GDP will
      be a float.
    """
    maxyr = gdpinfo['max_year'] 
    minyr = gdpinfo['min_year']
    outer = [] #for list of tuples
    inner = () #for tuples
    gdp = {} # for the unsorted gdp data
    
    for dic in gdpdata:
    #first try catch asses if year is a string that can be converted into an int
        try:
            key = int(dic)
        except ValueError:
            continue
    #second try catch asses if value is a string that can be converted into a float
        try:
            gdp[key] = float(gdpdata[dic])
        except ValueError:
            continue
    #if the value is empty that means there is no valid GDP data
        if gdpdata[dic] == '' or gdpdata[dic] == "":
            continue
    #GDP cannot be negative
        if float(gdpdata[dic]) < 0:
            continue
    #Sort the key's by least to greatest, also makes it a list of tuples
    gdpsorted = sorted(gdp.items(), key = lambda t: t[0])
    
    for tup in gdpsorted:
        #check again for empty value
        if tup[1] == '' or  tup[1] == "":
            continue
        key = tup[0]
        # value of key cannot be outside these bounds
        if (key >= minyr) and (key <= maxyr):
            inner = (key, float(tup[1]))
            outer.append(inner)
    return outer