def get_pokemon_id(species_ids):
    """Asks the user for a pokemon number for which they'd like the stats.

    If the user enters something invalid (ie. anything that's not a valid
    number of a pokemon), warns the user and repeats until they enter a valid
    pokemon number.

    Args:
        species_ids: a list of species ids (ints) sorted in increasing order

    Returns:
        the id chosen by the user as an int
    """
    max_pokemon_id = max(species_ids)
    # This is the prompt you'll display to the user to ask for their choice.
    # Don't modify it!
    prompt = 'Enter a pokemon number (1 - {0}): '.format(max_pokemon_id)
    # This is the prompt you'll display to the user if they enter something
    # invalid. Don't modify it! However, you'll be required to fill in the
    # placeholders with the appropriate values.
    warning = 'Please enter a number between 1 and {0}'.format(max_pokemon_id)

    while True:
        species_id = input(prompt)
        if species_id.isdigit():
            species_id = int(species_id)
            if species_id in species_ids:
                break
        print(warning)
    return species_id