python 学习小结 python 简明教程 1.python 文件 #!/etc/bin/python #coding=utf-8 2.main()函数 if __name__ == '__main__': 3.物理行与逻辑行; 下面是一个在多个物理行中写一个逻辑行的例子.它被称为明确的行连接. s = 'This is a string. \ This continues the string.' print s 它的输出: This is a string. This continues…
用一个列表来确定for循环的范围 >>> x = [0,1,2,3,4] >>> for i in x: print i, 0 1 2 3 4 循环一个字符串 >>> x = 'python' >>> for i in x: print i, p y t h o n 元组for循环 >>> x = [('http','https'),('java','python')] >>> for (a,b…