摘要: 在python中,可使用type()和isinstance()内置函数获取数据类型 如: (1)type()的使用方法: >>> a = '230' >>> type(a) <class 'str'> >>> a = 230 >>> type(a) <class 'int'> >>> a = 230 阅读全文
posted @ 2018-07-24 21:00 RamboBai 阅读(72702) 评论(0) 推荐(1) 编辑
摘要: 如果字符串中需要出现单引号和双引号怎么办? 如打印字符:Let's go shopping! (1)使用转义字符(\) >>> 'let\'s go shopping!'"let's go shopping!" (2) >>> "Let's go shopping"Let's go shopping 阅读全文
posted @ 2018-07-24 10:39 RamboBai 阅读(296) 评论(0) 推荐(0) 编辑