上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 48 下一页
摘要: #!/usr/bin/pythonab={ 'jack' : 'jack@1.com', 'ken' : 'ken@1.com', 'hellen' : 'hellen@1.com' }print 'jack address is %s' % ab['jack']ab['sten']='sten@1.com'del ab['ken']print '\nTHere are %d conntacts in the a 阅读全文
posted @ 2013-03-05 16:39 墨迹哥's 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 练习List的使用。。有点旧,不过复习下,很多都掌握不牢固。。。#!/usr/bin/pythonshoplist=['apple','jack','banane']print 'shoplist have',for i in shoplist: print i,print '\ni buy the shop:kate'shoplist.append('kate')print '\nthe shoplist have:',for i in shoplist: print i,prin 阅读全文
posted @ 2013-03-05 12:59 墨迹哥's 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 根据简明教程所解释:.pyc是在运行了一边程序的情况下才编译出来的。当你第二次使用该程序的时候,即可提高效率,因为所需要的函数已经编译完成。这个就是简明教程上说的,根据以上理解了下。这个概念值得记录。以前一直都不知道PYC是用来干嘛的,现在知道了。。。还有,它有个称呼叫:字节编译文件。。 阅读全文
posted @ 2013-03-04 21:24 墨迹哥's 阅读(201) 评论(0) 推荐(0) 编辑
摘要: Python的循环打印感觉总有点怪怪的,和Perl有点区别。。不过它有它的好处吧。回头特地开个文章细总结下。。#!/usr/bin/pythonfor i in range(1,5): print ielse: print "The end" 阅读全文
posted @ 2013-03-04 16:12 墨迹哥's 阅读(483) 评论(0) 推荐(0) 编辑
摘要: 根据简明教程上学习,感觉总有点错误。好像哪有问题。上面有些案例根本就编译不过去。。纳闷。。#!/usr/bin/pythonnumber=30while 1: guess=int(raw_input("Ender an integer:")) if guess==number: print "yes" elif guess<number: print "no" else: print "end!"else: print "Done" 阅读全文
posted @ 2013-03-04 16:09 墨迹哥's 阅读(135) 评论(0) 推荐(0) 编辑
上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 48 下一页