def main():
    # Validation loop.
    instr = input("Please enter a number: ")
    while not instr.isdigit():
        print("Sorry,", instr, "is not numeric.")
        instr = input("Please enter a number: ")

    # Now we know it consists of digits only, so is
    # (mostly) safe to convert.
    answer = int(instr)
    print("You answered", answer)
    print("Adding one gives", answer + 1)
    
    # What about negative numbers?

main()

