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

Python基础

时间:2016-07-02 10:27:35      阅读:203      评论:0      收藏:0      [点我收藏+]

标签:

编码
  #coding=utf-8
函数入口
  if __name__== "__main__":
内置方法
  type:a=1 type(a)
  help:import time help(time)
  dir:dir(time)
常用基本数据类型
int 整型

boolean 布尔

string 字符串:

1.s = "i,am,lilei" 截取am print s[2:4] print s.split(‘,‘)[1]

2.ainfo = ‘i love php‘ replycontent = ainfo.replace(‘php‘,‘python‘)

list 列表

tuple 元组

dict 字典

Python基础

标签:

原文地址:http://www.cnblogs.com/cnki/p/5634824.html

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