码迷,mamicode.com
首页 > 编程语言 > 详细

ord在python是什么意思?

时间:2017-02-11 21:41:40      阅读:277      评论:0      收藏:0      [点我收藏+]

标签:character   help   整数   integer   ext   函数   int   cte   cti   

>>> help(ord)
Help on built-in function ord in module builtins:
ord(...) #这是一个函数
ord(c) -> integer #接受一个参数,返回值是int,整数
Return the integer ordinal of a one-character string. #参数是长度为1的字符,返回它对应的整数

示例:
>>> s = ord(‘a‘)
>>> s
97

ord在python是什么意思?

标签:character   help   整数   integer   ext   函数   int   cte   cti   

原文地址:http://www.cnblogs.com/mrchige/p/6390026.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!