摘要:
随机生成4位验证码: 1 import random 2 checkcode = '' 3 for i in range(4): 4 current =random.randrange(0,4) 5 if current == 2: 6 temp = chr(random.randint(65,90 阅读全文
摘要:
栈:后进先出 单向队列:先进先出 双向队列: import collections d = collections.deque() d.append('1') print(d) class: append: Add an element to the right side of the deque. 阅读全文
摘要:
Python执行某一类的时候,相当于执行__init__ 方法 例如:list() list __init__ set 是一个无序且不重复的元素集合,可看做数学中的集合 用法: 1.创建集合 s = set() 创建空集合 s = set([11,22,33]) s = set('asdfghh') 阅读全文