如何在此句子中添加整数?

问题描述

我正在尝试使python运行如下所示的语句。

"How much did you make this year: " #Enter amount here in cash

"Expect to pay (4% of your amount in cash) in taxes this year."

解决方法

您可以使用以下代码:

pay = int(input("How much did you make this year:"))
print(f"Expect to pay {pay * 0.04} in taxes this year.")
,

val =输入(“您今年赚了多少:”)

print(“今年预计要缴税” + str(0.04 * float(val))+“。)