0
how to print formatted unicode
i want to print unicode of given number i can format it to 4 digits i can print unicode of 4 digits by hardcoding But cant do it with getting a number i code: i=1 print('%04d'%(i))#output 0001 print('\u0001')#working print('\u%04d'%(i))#not working
1 Resposta
+ 1
The Unicode literal \uxxxxxx is not meant for specifying output length nor formatting the output. The `xxxxxx` characters following the backslash `\` symbol represents the value to be printed in hexadecimal format.