1. 首页
  2. 数据库
  3. 其它
  4. 给Python初学者的一些编程技巧

给Python初学者的一些编程技巧

上传者: 2020-12-31 20:02:27上传 PDF文件 58.85KB 热度 15次
交换变量 x = 6 y = 5 x, y = y, x print x >>> 5 print y >>> 6 if 语句在行内 print "Hello" if True else "World" >>> Hello 连接 下面的最后一种方式在绑定两个不同类型的对象时显得很cool。 nfc = ["Packers", "49ers"] afc = ["Ravens", "Patriots"] print nfc + afc >>> ['Packers', '49ers', 'Ravens', 'Patriots'] print str(1) + " world" >
下载地址
用户评论