fqas = None
while fqas not in ("yes", "no", "Yes", "No"):
fqas = input(">>> [yes/no]: ")
if fqas.lower() == "yes":
print("\nAwesome! Current pay: $", base_pay + 50)
elif fqas.lower() == "no":
fqas_no = int(input("if not, how much do you think she deserve? \n>>> "))
if 50 <= fqas_no :
print("AMAZINGGGG! current pay: $", base_pay + fqas_no)
continue
elif fqas_no <= 50 :
print("That's cool, current pay: $", base_pay + fqas_no)
continue
except ValueError:
print("Numbers only please")
如何添加最后一个循环以检查下的整数fqas_no?我已经检查了范围,但是我无法让它检查整数。SyntaxError当我尝试使用时,我得到一个无效的信息ValueError。
该代码可以正常工作,除了:
except ValueError:
print("Numbers only please")
HUH函数
蝴蝶不菲
郎朗坤
相关分类