![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
学习笔记
HedgerLin
初入江湖的程序猿
展开
-
Python核心编程 第六章练习
欢迎指正讨论6_2#!/usr/bin/env python# encoding: utf-8import stringimport keywordalphas = string.letters + '_'nums = string.digitskeywd = keyword.kwlistprint "Welcome to the Identifier Checker v2.0"print原创 2016-04-26 18:37:39 · 894 阅读 · 0 评论 -
Python核心编程 第七章练习
7_3#!/usr/bin/env python# encoding: utf-8if __name__ == "__main__": dct = dict(zip(["emxample", "port"], ['7_3', 80])) sorted_dct = sorted(dct) print sorted_dct print "the sorte原创 2016-04-30 15:48:58 · 605 阅读 · 0 评论 -
Python核心编程 第八章练习
欢迎拍砖8_2再这个题中,我试图用xrange代替range来解决问题,但是结果输出了‘xrange(2, 26, 4)’这样奇怪的答案。然后才理解了书上的“xrange不产生列表”这句话的含义。 ”’python if name == “main“: numbers = raw_input(“Please input from, to, incremen”) ls原创 2016-05-07 19:34:34 · 405 阅读 · 0 评论 -
Python核心编程 第九章练习
笔者刚刚开始Python的系统学习,所以在代码上还无法达到pythonic的水准,很多写法也都是按照C++的习惯来写的,希望能有前辈进行交流指导。欢迎拍砖9_1#!/usr/bin/python2# coding: utf-8if __name__ == '__main__': with open('example.txt') as f: for原创 2016-05-12 19:56:03 · 1160 阅读 · 0 评论 -
Python核心编程 第十章练习
笔者刚刚开始Python的系统学习,所以在代码上还无法达到pythonic的水准,很多写法也都是按照C++的习惯来写的,希望能有前辈进行交流指导。欢迎拍砖9_6#!/usr/bin/python# coding:utf-8def safe_open(file_name): try: f = open(file_name) except IOError, e:原创 2016-05-21 21:35:17 · 453 阅读 · 0 评论