在 python 中,如果我想让某人以美元输入贷款金额,我可以编写如下代码:
# Loan amount
L = float(input("Enter the loan amount: $"))
Run Code Online (Sandbox Code Playgroud)
但如果我想要的话,比如说利率,它是一个百分比。如果我编码:
# Interest rate
I = float(input("Enter the interest rate: "))
Run Code Online (Sandbox Code Playgroud)
我怎样才能让百分号 % 在他们输入的内容后显示出来?