With
print(" {:d}). {:s} ({:d})".format(i, account, num_char))
I get the error:
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 4: ordinal not in range(128)
but when I change it to:
print " %d). %s (%d)" % (i, account, num_char)
then there are no problem and output is identical with both prints.
So what is wrong in the first expression and why does it work in the second?
.encode("utf-8")but how is the output identical in both prints if one causes an error?