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