如何在这句话中添加一个整数?

我试图让 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."


倚天杖
浏览 60回答 2
2回答

MMTTMM

您可以使用以下代码:pay = int(input("How much did you make this year:")) print(f"Expect to pay {pay * 0.04} in taxes this year.")

MMMHUHU

val = input("你今年赚了多少钱:")print("今年预计缴纳 "+str(0.04*float(val))+ " 税款。")
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python