Notice
Recent Posts
Recent Comments
Link
나의 개발일지
[Python] 유니코드 ↔ 문자 변환 (ord, chr) 본문
- ord() : 문자를 유니코드로 변환
- chr() : 유니코드를 문자로 변환
print(ord("A")) # "A"를 65로 변환
print(chr(65)) # 65를 "A"로 변환
a = "ABCDEF"
b = [65, 66, 67, 68, 69, 70]
for i in a:
print(ord(i)) # 65, 66, 67, 68, 69, 70
for i in b:
print(chr(i)) # A, B, C, D, E, F
'백준' 카테고리의 다른 글
[Python] 소인수 분해 알고리즘 (0) | 2023.03.03 |
---|---|
[Python] 최대 공약수 알고리즘 (유클리드 호제법) (0) | 2023.03.03 |
[Python] 소수 구하는 방법 (에라토스테네스의 체) (0) | 2023.02.22 |
[Python] 정렬 (sort, sorted) (0) | 2023.02.16 |
[Python] 시간 복잡도 🕒 (0) | 2022.12.26 |
Comments