def贷款(x): x = int(raw_input(“你的FICO得分是多少?”))
如果x> = 760: 打印(“费率= 3.080”)
elif x> = 700: print(“Rate = 3.302”)
elif x> = 680: print(“Rate = 3.479”)
elif x> = 660: print(“Rate = 3.693”)
elif x> = 640: print(“Rate = 4.123”)
elif x> = 620: 打印(“费率= 4.66”)
否则: print('Approval = No')
答案 0 :(得分:0)
问题应该是raw_input
功能。试试这个:
def Loans(x):
x = int(input("What is your FICO score? "))
if x >= 760:
print ("Rate = 3.080")
elif x >= 700:
print ("Rate = 3.302")
elif x >= 680:
print ("Rate = 3.479")
elif x >= 660:
print ("Rate = 3.693")
elif x >= 640:
print ("Rate = 4.123")
elif x >= 620:
print ("Rate = 4.66")
else:
print ('Approval = No')
Loans(10)
有关重命名功能的更多详细信息:https://stackoverflow.com/a/954840/2741329