我正在解决 YaContest 中的一个问题。在 PyCharm 中它正确显示所有内容,但在 YaContest 中它给出以下错误 -
stdout:
/bin/sh ./build.sh 1>&2
stderr:
solution.py:5:20: E226 missing whitespace around arithmetic operator
Код не соответствует стандарту PEP8
или в нем есть синтаксические ошибки
make: *** [Makefile:2: build] Error 1
这是我的代码 -
tovar = str(input())
price = int(input())
weight = int(input())
money = int(input())
price_tovar = price*weight
sdacha = money - price_tovar
print('Чек')
print(tovar, ' - ', weight, 'кг', ' - ', price, 'руб/кг', sep='')
print('Итого: ', price_tovar, 'руб', sep='')
print('Внесено: ', money, 'руб', sep='')
print('Сдача: ', sdacha, 'руб', sep='')
告诉我,我做错了什么? PyCharm 正确显示所有内容。

我使用黑色模块格式化代码,结果如下:
我认为问题出在第 5 行 - 有必要在 的左侧和右侧指定空格
*。第 5 行是:
第 20 个字符是
*。如果你逐字翻译错误的英文文本,它会说:“算术运算周围没有足够的空格。”这不是一个错误,只是不符合标准
PEP8。但 Yandex 已将编译配置为将其视为错误。只需在乘号周围添加空格即可: