如何在字符串中找到字符的ascii值?

Vil*_*lva 2 python

我正在尝试将字符串中的字符转换为Python中的ascii值

喜欢ord('a [i]')但ord只期待字符不是字符串!!

在python中有没有其他方法可以解决这个问题.

Sve*_*ach 9

>>> s = "string"
>>> map(ord, s)
[115, 116, 114, 105, 110, 103]
Run Code Online (Sandbox Code Playgroud)