帮我写个代码python代码:接受两个数,一个为用户一年期定期存款本金,一个为一年期定期存款利率。计算一年期满后本金与利息总额。说明:(1)存款金额以人民币元为单位;(2)输入利…
- User
帮我写个代码python代码:接受两个数,一个为用户一年期定期存款本金,一个为一年期定期存款利率。计算一年期满后本金与利息总额。说明:(1)存款金额以人民币元为单位;(2)输入利率时不需要输入百分号,例如一年期定期存款年利率为2.52%,用户输入 2.52 即可。
Assistant
Below is a simple Python program that fulfills your request. This program will:
-
Accept two inputs from the user:
principal: The initial amount of money (本金) for a one-year time deposit, in Chinese Yuan (CNY).interest_rate: The annual interest rate for the one-year time deposit, as a percentage (without the percent sign).
-
Calculate the total amount (本金 + 利息) after one year.
-
Display the result to the user.
python-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.