def get_at_bats() -> str:
    """Get the number of at bats and confirm it is a valid integer."""
    while True:
        try:
            at_bats: int = int(input("At bats: "))
        except ValueError:
            print("Invalid integer. Try again.")
            continue

        if at_bats >= 0 and at_bats <= 10000:
            return str(at_bats)
        else:
            print("Invalid entry. Must be from 0 to 10,000.")