# -*- coding: utf-8 -*-
import sys
import time
import binascii
if __name__ == '__main__':
while True:
msg = input('请输入一个大写字符:')
if len(msg) > 1:
continue
if msg[0].isascii() and msg[0].isupper():
temp = bytes(msg, encoding = "utf8")[0]
print('对应的ASCII码:十进制:%d 16进制:0x%x'% (temp, temp))
print('对应的小写字符为:{}'.format(msg[0].lower()))
temp = bytes(msg[0].lower(), encoding="utf8")[0]
print('对应的小写字符为:%d' % temp)
python字符转换
最新推荐文章于 2024-05-12 22:41:09 发布