Convert the entered string to Asc Code

Asked 2 years ago, Updated 2 years ago, 17 views

Please use the order function to count the number of uppercase and lowercase letters in the string, Korean, and other characters.

python

2022-09-22 18:43

1 Answers

If uf8, it has the following range:

 English capital letters: 0x41-0x5A
Lowercase letters: 0x61-0x7a
Korean range: AC00-D7AF

Hangul falls into the above range, so you can see the following results.

str = 'Ganadara'
for c in str: 
    print(hex(ord(c)))

0xac00
0xb098
0xb2e4
0xb77c

Please try English characters, and you can compare each character and count.


2022-09-22 18:43

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.