LoginSignup
0
0

chr()とは

Posted at

chr()とは

chr()関数は指定したUnicodeの値に対応する文字を返します。この関数は整数を引数として受け取り、その整数のUnicode表現を文字列として返します。

例えば、chr(65)とすると'A'が返されます。これは、Unicodeコード65が大文字の’A’に対応しているためです。

chr(65).py
print(chr(65) #出力 A

また、chr(12354)とすると、'あ'が返されます。これは、Unicodeコード12354がひらがなの’あ’に対応しているためです。

chr(12354).py
print(chr(12354) #出力 あ
0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0