active=bool() active=True while active: a = input() print("Please enter a positive integer!\nEnter 'quit' to end the program." ) if a == 'quit': active=False else: a = int(a) if a not in [i for i in range(1,101)]: print('输入不合法,请重新输入') continue else: if a%8 == 0: print('%d is a multiple of 8.'%a) else: print('%d is not a multiple of 8.'%a)