def assign_road_conditions(x):
    """Assign road conditions as paved or unpaved to Province roads

    Parameters
        x - Pandas DataFrame of values
            - road_type - String name for type of road: national, province or rural
            - material_code - String code for road materials: 
                [('A','Asfalto'),('H','Hormigon'), ('R','Ripio'), ('T','Tierra'), ('B','Tratamiento')]

    Returns
        String value as paved or unpaved
    """
    asset_type = str(x.road_type).lower().strip()

    if asset_type == 'national':
        if ('A' in str(x.material_code)) or ('B' in str(x.material_code)) or ('H' in str(x.material_code)):
            return 'paved'
        elif ('R' in str(x.material_code)) or ('T' in str(x.material_code)):
            return 'unpaved'
        else:
            return 'paved'
    elif str(x.surface).lower().strip() in ('pavimentado, pavimento en construcc'):
        # Anything else not included above
        return 'paved'
    else:
        return 'unpaved'