摘要:
代码如下: 点击查看代码 # coding=utf-8 # 更多练习 print "Let's practice everything." print 'You\'d need to know \'bout escapes with \\ that do \n newlines and \t tab 阅读全文
摘要:
代码如下: 点击查看代码 # coding=utf-8 # 函数可以返回东西 def add(a, b): # 加法 print "ADDING %d + %d" % (a, b) return a + b def subtract(a, b): # 减法 print "SUBTRACTING %d 阅读全文
摘要:
代码如下: 点击查看代码 # -*-coding:utf-8- -*- # 函数和文件 from sys import argv script, input_file = argv def print_all(f): # 定义 print_all 读 f print f.read() def rew 阅读全文
摘要:
代码如下: 点击查看代码 # -*-coding:utf-8- -*- # 函数和变量 def cheese_and_crackers(cheese_count, boxs_of_crackers): print "You have %d cheeses!" % cheese_count print 阅读全文