yao646276197 2022-12-05 21:41 采纳率: 0%
浏览 29

TypeError: can't multiply sequence by non-int of type 'float'

a=float(input('销售额:'))
b=float(input('销售量:'))
c=float(input('均价:'))
tpi=a+b0.01c-[683.34-c)/c]b0.003
print=('双十一品牌总增价:',tpi)

报错:TypeError: can't multiply sequence by non-int of type 'float'

什么意思?怎么改正?

  • 写回答

1条回答 默认 最新

  • 请叫我问哥 新星创作者: python技术领域 2022-12-05 22:07
    关注

    为什么用中括号?代码认为中括号是列表,所以不能和浮点数相乘

    评论

报告相同问题?

问题事件

  • 创建了问题 12月5日