我正在尝试使用字符串格式化实现Unicode下标...
我知道可以像这样做...
但我实际需要的是这样的东西,因为我需要下标来遍历一个范围。显然,这并不起作用。
>>>print('Y\u2081')
Y₁
>>>print('Y\u2082')
Y₂
但我实际需要的是这样的东西,因为我需要下标来遍历一个范围。显然,这并不起作用。
>>>print('Y\u208{0}'.format(1))
File "<ipython-input-62-99965eda0209>", line 1
print('Y\u208{0}'.format(1))
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 1-5: truncated \uXXXX escape
希望得到您的帮助