Chinaunix首页 | 论坛 | 博客
  • 博客访问: 21058
  • 博文数量: 27
  • 博客积分: 585
  • 博客等级: 中士
  • 技术积分: 270
  • 用 户 组: 普通用户
  • 注册时间: 2012-07-20 17:11
文章分类

全部博文(27)

文章存档

2013年(1)

2012年(26)

我的朋友
最近访客

发布时间:2012-12-27 10:21:26

六、向数组中添加内容append   shoplist = ['apple', 'mango', 'carrot', 'banana']   print 'I have', len(shoplist),'items to purchase.'   print 'These items are:', # Notice the comma at end of the line   for item in shoplist:   # 遍历数组使用的是 for item in shoplist   &nb......【阅读全文】

阅读(150) | 评论(0) | 转发(0)

发布时间:2012-12-27 09:22:21

一、python中的List:   Example 3.25. key s,  values  和  i tems  函数 >>> params =  {"server":"mpilgrim", "database":"master", "uid":"sa", "pwd":"secret"} >>> params.keys()   (1) ['server', 'uid', 'database', 'pwd']   >>> params.......【阅读全文】

阅读(248) | 评论(0) | 转发(0)

发布时间:2012-12-27 09:17:17

单引号和双引号: 在双引号中的字符串与单引号中的字符串的使用完全相同使用三引号('''或"""): 利用三引号,你可以指示一个多行的字符串。你可以在三引号中自由的使用单引号和双引号。 例如: '''This is a multi-line string. This is the first line. This is the second line. "What's your name?," I asked. He said "Bond, James Bond." '''转义符: 'What\'s you name'   (注意要加上\来转义'不然python会不认识')级......【阅读全文】

阅读(297) | 评论(0) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册