如何给这句话加一个整数?
How to add an integer to this sentence?
我正在尝试使 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 = input("你今年赚了多少钱:")
print("预计今年要缴纳 "+str(0.04*float(val))+ " 税款。")
我正在尝试使 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 = input("你今年赚了多少钱:")
print("预计今年要缴纳 "+str(0.04*float(val))+ " 税款。")