摘要:# -*- coding: cp936 -*-#D:\workspace\Pytion_workspace\004_list.pysCollege=1231# len() range() print 'len() 和 range()函数'print len(sCollege)print range(
阅读全文
摘要:# -*- coding: cp936 -*-#D:\workspace\Pytion_workspace\004_list.py# 001_分支结构 nAge =15if nAge==1: print 'children'elif nAge==2: print 'haha children'els
阅读全文
摘要:# -*- coding: cp936 -*-#D:\workspace\Pytion_workspace\002_list.py# 005_id()对象再内存中地址 nListNums=[22,33,44,55]print nListNumsa =nListNums[0]print ('addre
阅读全文
摘要:# 001_数学 import decimaldir(decimal)# 002_动态执行命令 exec('print 123')#execfile("D:\workspace\Pytion_workspace\001_list.py")#eval() #用字符串 动态 创建# 003_字符串截取
阅读全文
摘要:# -*- coding: cp936 -*-#D:\workspace\Pytion_workspace\001_list.py# list print '--001 def list'mList = [1,2,3,4]print(mList) # iterator element of list
阅读全文
摘要:一、输出流 1.通配符的使用 '%d %s' print '%d hellow world %s' % (1,'ss') 2.'print输出流' 的重定向 f=open('d:\\temp\\a.txt','w') # 把输入流中的内容,输出到目标文件中 print >> f ,'ss' f.cl
阅读全文