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

'''
股价计算小程序 小数点后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)

 

posted @ 2023-03-21 23:05  胖豆芽  阅读(32)  评论(0编辑  收藏  举报