개발자 뺚
[Python] 아스키 코드(ASCII) 함수 본문
ord(character)
# example
print(ord("A"))
# terminal
65
ord() 함수는 문자를 매개변수로 입력하면 이를 아스키 코드에서 정수로 변환하여 반환하는 함수이다.
chr(integer)
# example
print(chr(65))
# terminal
A
chr() 함수는 정수를 매개변수로 입력하면 이를 정수에서 아스키 코드로 변환하여 반환하는 함수이다.
'Information > Python' 카테고리의 다른 글
[Python] Python 내장(built-in) 함수 (0) | 2024.02.18 |
---|---|
[Python] 리스트(List) 메서드 (0) | 2023.08.30 |
[Python] pandas 모듈(Module) 자료구조(Data Structure) (0) | 2023.08.29 |
[Python] random 모듈(Module) (6) | 2023.07.16 |
[Python] datetime 모듈(Module) (0) | 2023.07.16 |