[oeasy]python0048_取整_int_float_浮点型_cast_扮演_tab_制表键_制表符
转化为10进制
回忆上次内容
- 上次 把其他进制
- int 来自于 integer
完整
的 和 零散
的
- 可以把
零散
的小数
取整


- 3.3 是 一个浮点型 的 小数
- 这个过程叫做cast
cast
- cast原意是投掷
- cast a spell 施法 投一个咒语
- cast a vote 投票
- cast 铸造 把铁水投入到磨具中

投影

演员表


cast


字符串


查看文档

- 把 浮点型(float)的 3.9
- 小数部分 截掉(truncates)
- 转化为 整型(int)的 3

tab 键
- tab 是一个按键
- 试着 求出tab键对应 的 ascii序号
- 也就是
\t
对应的数值

转化与输出


绕回来


反向绕

转化


总结
- 这次在各种类型间不断转化
- int 整型数字
- float 浮点型数字
- str 字符串
- 最后温习了 转义字符
\t
类似的还有
- 还有 通过数字 得到ascii字符
- 如果
- 我们下次再说!👋
- 蓝桥->https://www.lanqiao.cn/courses/3584
- github->https://github.com/overmind1980/oeasy-python-tutorial
- gitee->https://gitee.com/overmind1980/oeasypython
- 视频->https://www.bilibili.com/video/BV1CU4y1Z7gQ 作者:oeasy
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/163406.html
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!