Think Python问题记录
文章平均质量分 64
u010565244
这个作者很懒,什么都没留下…
展开
-
python:如何打印可能含有子tuple的Tuple
#!/user/bin/python#encoding=utf-8#Filename:using_tuple.pydef disList(zoolist): for item in zoolist : if isinstance(item,tuple): disList(item) else: prin原创 2014-02-09 23:17:30 · 1369 阅读 · 0 评论 -
AttributeError: 'tuple' object has no attribute 'Multi'
题目:If I leave my house at 6:52 am and run 1 mile at an easy pace (8:15 per mile), then 3 miles attempo (7:12 per mile) and 1 mile at easy pace again, what time do I get home for breakfast?代码第一原创 2014-02-11 00:24:38 · 13038 阅读 · 0 评论 -
关于python 的line.strip()方法
测试文本abcabcdshow me the money代码一:def showfile (filepath): startTime=datetime.datetime.now() f=open(filepath) lineends='\\n' failure=0 w原创 2014-02-14 11:12:37 · 83684 阅读 · 4 评论 -
python file.readlines无法循环
def showfile2 (filepath): startTime=datetime.datetime.now() f=file(filepath) while True: flag=True lines=f.readlines(10000) failure=0 for line原创 2014-02-14 11:32:31 · 2134 阅读 · 0 评论 -
list index out of range
题目是:Two words are a “reverse pair” if each is the reverse of the other. Write a programthat finds all the reverse pairs in the word list. 代码:#!/usr/bin/python#encoding=utf-8import datetime原创 2014-02-15 00:18:51 · 1838 阅读 · 0 评论