作者:LAMP小白 点击:1563 发布日期:2013-10-16 00:21:47 返回列表
数字 字符串 列表 元组 字典
查看数据类型 type()
123L 强制定义为长整型
复数类型
c=3.14 实数
c=3.14j 复数类型 complex
字符串
定界符 """ """
通过索引获取字符串的值
字符串拼接 +
切片
a[起始值:结束值:步长值]
#!/usr/bin/python a=1 print type(a) b=1L print type(b) c=3.14j print type(c) d=""" this is a text first line second line """ print d e="abcefgh" print e[1:2]+e[:] print e[::2]
上一篇:python运算符和表达式 下一篇:快递查询API