print('Ketsumaimo')
Since Python3 supports UTF-8 by default, "Ketsumaimo" is output as it is.
print u'Ketsumaimo'
print 'Ketsumaimo'.encode('utf-8')
# -*- coding: utf-8 -*-
print 'Ketsumaimo'
In Python2 series, there are two types of character strings, byte character strings and Unicode character strings, and ASCII is supported by default, so byte character strings are output. In order to display a multi-byte Unicode string such as "Ketsumaimo", it is necessary to convert the byte string to a Unicode string.
Recommended Posts