0.目录 1.参考2.没事画个流程图3.完整代码4.改进方向 1.参考 https://en.wikipedia.org/wiki/Cosine_similarity https://zh.wikipedia.org/wiki/%E4%BD%99%E5%BC%A6%E7%9B%B8%E4%BC%BC%E6%80%A7 Cosine similarityGiven two vectors of attributes, A and B, the cosine similarity, cos(θ),
在工作中经常遇到一些验证码,这些是怎么生成的呢,今天我用Python编写了下 import randomcode = []for i in range(6): if i == random.randint(1,5): code.append(str(random.randint(1,4))) else: tmp = random.randint(65,90) code.append(chr(tmp))print ''.join(code)