from typing import Optional


def int_input(prompt: str) -> Optional[int]:
    """Print ``prompt``; ensure the user enters an integer and return it."""
    text = input(prompt + " ")
    if not text:
        return None
    try:
        number = int(text)
    except ValueError:
        print("No, you must type an integer.")
        return int_input(prompt)
    return number