name 'exchangeRate' 未定义

问题描述 投票:0回答:0

这是我的代码:

brand ='apple'
ExchngeRate  = 1.45666
message='The price of this  %s laptop is %d USD and the exchange rate is %4.2f USD to 1 EUR' % (brand,1299,exchangeRate)

我得到这个错误:

NameError                                 Traceback (most recent call last)
<ipython-input-4-076695279033> in <cell line: 3>()
      1 brand ='apple'
     2 ExchngeRate  = 1.45666`
----> 3 message='The price of this  %s laptop is %d USD and the exchange rate is %4.2f USD to 1 EUR' % (brand,1299,exchangeRate)

NameError: name 'exchangeRate' is not defined
syntax-error undefined python-exec
© www.soinside.com 2019 - 2024. All rights reserved.