Here is the short and really simple approach to ask user to enter an integer until it's done:
while True: try: quantity = int(input("Quantity: ")) break except: print("Error: Quantity must be a whole number.")