
功能实现代码
枫2928715868
风雨兼程
展开
-
Python中,不考虑可迭代对象,使用不定长参数实现max()函数的功能
Python中,不考虑可迭代对象,使用不定长参数实现max()函数的功能def mymax(*args): if len(args) >= 2: maxnum = args[0] for x in args: if maxnum < x: maxnum = x return...原创 2019-06-20 00:39:48 · 652 阅读 · 0 评论 -
AttributeError: type object 'MongoClient' has no attribute 'test'解决小示例
AttributeError: type object ‘MongoClient’ has no attribute ‘test’报错后检查,发现建立连接时,因为输入过快,未采用联想,导致MongoClient后面的()忘记添加,添加后解决该错误。from pymongo import MongoClientclient = MongoClient()...原创 2019-07-11 21:52:39 · 2446 阅读 · 0 评论