摘要: 2.1 标识符与关键字标识符规则一:关于引导字符和后续字符,只要是Unicode编码的字符都可以作为引导字符包括ASCII字符,下划线(_),以及大多数非英文字符。后续字符是任意的引导字符,或者非空格,包括Unicode中认为是数字的字符。标识符大小写敏感。规则二:标识符不能与Python的关键字重名。Python中的关键字:and continue except global lambda pass whileas def False if None raise withassert del finally import nonlocal return yieldbreak elif for 阅读全文
posted @ 2011-05-25 12:15 小苏打 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 只是做了一部分,没有全部做,有的题目,2题合并为一题了。1.1View Code 1 numbers = [] 2 count = 0 3 sum = 0 4 mean = 0 5 6 while True: 7 try: 8 line = input("enter a number or Enter to finish:") 9 if line: 10 num = int(line) 11 if num not in numbers: 12 numbers.append(num) 13 count += 1 14 sum += num 15 else: 16 break 阅读全文
posted @ 2011-05-25 00:17 小苏打 阅读(263) 评论(0) 推荐(0) 编辑