Print Japanese | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Print Japanese

Can I print Japanese characters on Python using print()? If so how can I print them? I tried using the unicodes of the characters but it didnā€™t work. For example, I tried using print(ā€˜\u3041ā€™) to print 恁, but it didnā€™t work, it gave Error.

30th Apr 2018, 11:57 PM
Duc Van Khanh Tran
Duc Van Khanh Tran - avatar
2 Respostas
+ 6
Perhaps what you use to view the output makes a difference? Are we sure that all interpreters/IDEs are capable of outputting Japanese characters?
1st May 2018, 2:29 AM
Fox
Fox - avatar
+ 2
Did you attempt using the "\u[4 digit hexadecimal]" notation? If youā€™re not and youā€™re using "\U", well. Iā€™m not sure, as I use \u always. (I mean that literally.) If the characters for example, if you want to print the character "恁" (I cannot read Japanese, so if that is offensive, I am very, VERY sorry), you would type "print('\u3041')" (minus the double quotes, obviously.)
1st May 2018, 1:01 AM
Astutewinter
Astutewinter - avatar