#input and judge gender
while True:
gender = input("Please input your gender (m for male, f for female):")
if(gender =='m' or gender == 'f'):
break
else:
print("Error! you must input a valid letter!Please try again!\n")
continue
python - input()用户输入的值不合法则要求重新输入
最新推荐文章于 2023-05-30 04:21:24 发布