Python中Number类型变量的转换2

2025-11-08 16:57:10

1、str() :将对象转换为字符串。

Python中Number类型变量的转换2

Python中Number类型变量的转换2

2、repr():将对象转换为表达式字符串 。

Python中Number类型变量的转换2

Python中Number类型变量的转换2

3、eval():用来计算值为有效Python表达式的字符串,并返回一个对象。

Python中Number类型变量的转换2

Python中Number类型变量的转换2

4、ord():将Unicode字符转换为它的整数值。

Python中Number类型变量的转换2

Python中Number类型变量的转换2

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢