1.for x in 集合:print(x) #输出集合内的元素2.列表:[] #1.切片操作: [:] #全部遍历 [1] #输出第二个元素 [1:3] #遍历第二个到第三个元素 [1:] #遍历第二个到最后一个元素 [:3] #遍历前三...
分类:
编程语言 时间:
2014-07-28 11:26:30
阅读次数:
244
也是自己之前学习的笔记。读文件file_obj2=open('hello.txt','w')conta='my name is Bb'file_obj2.write(conta)v=file_obj2.readlines()print v输出不唯一数1 (这是一个国外Python练习网站上的题...
分类:
编程语言 时间:
2014-07-23 22:21:17
阅读次数:
497
Python的print函数输出中文字符串对齐问题的解决方案。...
分类:
编程语言 时间:
2014-07-22 23:49:57
阅读次数:
380
print后用一个逗号结尾就可以禁止输出换行,例子如下>>> i=0>>> while i >> i=0>>> while i < 3: print i, i+=1 0 1 2
分类:
编程语言 时间:
2014-07-18 18:16:39
阅读次数:
574
命令行提示符下,python print输出unicode字符时出现以下UnicodeEncodeError:'gbk'codec can't encode character '\u30fb不能输出 unicode 字符,程序中断。解决方法:sys.stdout=io.TextIOWrapper(...
分类:
编程语言 时间:
2014-07-16 16:01:53
阅读次数:
270
PrintEcho print 输出转型$sum=0;$total=(float)$sumIsset() unset()判断一个变量是否存在$echo intval$sum 浮点型Define(“total”,100); 常量一旦定义就不可更改判断句14){Echo’内容’;}?>14){Echo’...
分类:
Web程序 时间:
2014-06-25 21:47:59
阅读次数:
281
1.开始结束标记2.定义变量:$变量名例:$str="锦清笋";不需要指明数据类型3.输出语句:(1)echo"helloworld!";---echo命令(2)print();输出语句,是函数,有返回值。输出成功返回1,失败返回0。(3)printf();格式化输出字符串。例:printf("%d...
分类:
Web程序 时间:
2014-05-19 13:14:48
阅读次数:
337