【发布时间】:2020-03-30 19:54:19
【问题描述】:
在这段代码中,您可以看到我正在创建一个系统,通过检查用户的信用评分,房产的基本价格会发生变化。显然我无法实现折扣价格,因为我无法为信用为 670 到 850 的人创建 if 语句。请提出建议。
# Prompt section for customer
credit_check = '''The listing of this property is currently at $1,000,000.
In order to continue you must participate in a credit check that will evaluate your options of payment.'''
print(credit_check)
answer = input('Would you like to continue on to the credit check?(yes or no) ')
# Results of Prompt
if answer == "yes":
credit = input('Please enter your credit score ranging 300 through 850: ')
elif answer == "no":
print('''Unfortunately we can not serve you unless you provide a credit check
,thank you.
Chandlers Estate Co.''')
# This is the piece of code that I'm stuck on.
if int(credit) == :
print("hi")
【问题讨论】:
-
对不起,如果我误解了,但检查
credit是否在 670 和 850 之间的语句将是670 <= int(credit) <= 850 -
哇,这就是问题所在。非常感谢!
-
你能澄清问题是什么吗?
标签: python if-statement input range