There is a script when I execute it, instead of Russian characters appears:
X Получено: None | Ожидалось: '\xd0\xad\xd1\x82\xd0\xbe\xd1\x82 \xd1\x84\xd0\xb8\xd0\xbb\xd1\x8c\xd0\xbc \xd1\x85\xd0\xbe\xd1\x80\xd0\xbe\xd1\x88'. Google suggested solving the problem by adding lines to the beginning of the file:
# -*- coding: utf-8 -*- from __future__ import unicode_literals But in this case, the conclusion:
u'\u042d\u0442\u043e\u0442 \u0444\u0438\u043b\u044c\u043c \u0445\u043e\u0440\u043e\u0448' That is, the prefix "u" is added, but this has almost no effect on the total. I tried to change the encoding of the file. Does not help. I understand, the question is stupid and is solved, most likely, elementary.
Code:
def main(): test(donuts(4), 'Количество : 4') test(donuts(9), 'Количество : 9') Function code:
def donuts(count):+ if count<10: rezult = 'Количество: {}'.format(count) else: rezult = 'Количество: много' return rezult test function:
def test(got, expected): if got == expected: prefix = ' OK ' else: prefix = ' X ' print('%s Получено: %s | Ожидалось: %s' % (prefix, repr(got), repr(expected))) The problem is the same in Ubuntu and Windows. Currently trying to fight in Windows XP