
while True: x = input('请输入一个正整数: ') if x.isdigit(): if int(x) > 0: break