首页 > 其他 > 详细

ex34.py

时间:2016-11-24 07:58:22      阅读:162      评论:0      收藏:0      [点我收藏+]
 1 # -*- coding:GBK -*-
 2 animals = ["", "python", "孔雀", "袋鼠", "鲸鱼", "鸭嘴兽"]
 3 
 4 place1 = animals[0]
 5 print ("the place1 animal is %r." % place1)
 6 
 7 no3 = animals[3]
 8 print ("the no3 animal is %r." % no3)
 9 
10 no1 = animals[0]
11 print ("the no1 animal is %r." % no1)
12 
13 place3 = animals[2]
14 print ("the place3 animal is %r." % place3)
15 
16 no5 = animals[5]
17 print ("the no5 animal is %r." % no5)
18 
19 place6 = animals[5]
20 print ("the place6 animal is %r." % place6)
21 
22 place4 = animals[3]
23 print ("the place4 animal is %r." % place4)
24 
25 #应该看到的结果
26 ‘‘‘the place1 animal is ‘熊‘.
27 the no3 animal is ‘袋鼠‘.
28 the no1 animal is ‘熊‘.
29 the place3 animal is ‘孔雀‘.
30 the no5 animal is ‘鸭嘴兽‘.
31 the place6 animal is ‘鸭嘴兽‘.
32 the place4 animal is ‘袋鼠‘.‘‘‘

 

ex34.py

原文:http://www.cnblogs.com/jiangzhipeng/p/6096042.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!