%d %f %s 前面%后面字母

发布时间 2023-03-22 21:13:24作者: 胖豆芽
'''
股价计算小程序 小数点后2位数

'''
name="recoo"
stock_price=1
stock_code=123456
stock_price_daily_growth_factor=1.2
growth_days=7
message=f"公司是{name},股票价格:{stock_price},股票代码:{stock_code}"
message2="每日增长系数是:%s,经过%d天后,股票达到:.2%f"%(stock_price_daily_growth_factor,stock_price*growth_days,stock_price*1.2**7)
print(message)
print(message2)