把字符串变成unicode码位列表(列表推导式)



demo_str = "hello world"

demo_ret = [ord(x) for x in demo_str]   
# ord函数 https://blog.csdn.net/qq_42327755/article/details/86596696
print(demo_ret)
发布了73 篇原创文章 · 获赞 14 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/qq_42327755/article/details/91388187
今日推荐