一:迭代器 在python中,很多对象可以直接通过for语句来直接遍历,例如:list、string、dict等等,这些被称为可迭代对象 迭代器是一个可以I记住遍历的位置的对象。 在python中,支持迭代器协议的就是实现对象的iter()和next()方法。 iter()方法返回迭代器本身 nex ...
分类:
其他好文 时间:
2017-07-28 22:31:12
阅读次数:
210
1.CURL是利用URL语法在命令行方式下工作的开源文件传输工具。 2.它被广泛应用在Unix、多种Linux发行版中。而且有DOS和Win32、Win64下的移植版本号。 3.它支持非常多协议:FTP, FTPS, HTTP, HTTPS, GOPHER, TELNET, DICT, FILE 以 ...
分类:
Web程序 时间:
2017-07-28 22:09:45
阅读次数:
168
1.block在俩个UIViewController间传值 近期刚学了几招block 的高级使用方法,事实上就是利用block语法在俩个UIViewController之间传值,在这里分享给刚開始学习的人,同一时候也方便我自己理解。我们知道UINavigationController类管理UIVie ...
分类:
其他好文 时间:
2017-07-28 14:44:37
阅读次数:
216
#!/usr/bin/env python # -*- coding:utf-8 -*- # by wk ''' 1、写函数,,用户传入修改的文件名,与要修改的内容,执行函数,完成批了修改操作 2、写函数,计算传入字符串中【数字】、【字母】、【空格] 以及 【其他】的个数 3、写函数,判断用户传入的... ...
分类:
其他好文 时间:
2017-07-27 18:36:09
阅读次数:
147
using System.Collections.Generic; 当使用字典类时,循环 ...
分类:
Web程序 时间:
2017-07-27 15:58:14
阅读次数:
172
def save_file(self,msg,f,indent = 0): '''将结果格式化写入文件''' block = indent if type(msg).__name__ == 'dict': for k, v in msg.items(): # print block *... ...
分类:
其他好文 时间:
2017-07-26 23:25:05
阅读次数:
146
【139-Word Break(单词拆分)】 【LeetCode-面试算法经典-Java实现】【全部题目文件夹索引】 原题 Given a string s and a dictionary of words dict, determine if s can be segmented into a ...
分类:
编程语言 时间:
2017-07-26 20:24:10
阅读次数:
679
tuple虽然是不变对象,但试试把(1,2,3)和(1,[2,3])放入dict或set中,并解释结果。dict和set的键值都具有唯一性,如果有两个list的话是无法判断是否不同。
分类:
编程语言 时间:
2017-07-26 17:55:57
阅读次数:
109
1获取命令行输入库docoptarguments = docopt(__doc__)from_station = stations.get(arguments[''])to_station = stations.get(arguments[''])2.dict内置python函数,传递元素是元组的列... ...
分类:
其他好文 时间:
2017-07-26 10:40:07
阅读次数:
145
Given a binary search tree (BST) with duplicates, find all the mode(s) (the most frequently occurred element) in the given BST. Assume a BST is define ...
分类:
其他好文 时间:
2017-07-26 02:03:35
阅读次数:
280