def rivers_with_stations(stations):
    """Creates a set of names of rivers which have at least one station. Used in Task1D.py
    
    Args: stations (list of MonitoringStation objects)

    Returns: rivers_monitored (set of names of rivers)"""
    
    # Create empty set to store the names of rivers monitored (set used to avoid duplicates)
    rivers_monitored = set()

    # station attribute river added to set for all stations in list
    for station in stations:
        rivers_monitored.add(station.river)
    
    return rivers_monitored