1. 基本语法 isinstance(object, classinfo) Return true if the object argument is an instance of the classinfo argument, or of a (direct, indirect or virtual) subclass thereof. Also return true if classinfo is a type object (new-style class) and object is
检查并判断密码字符串的安全强度 import string def check(pwd): #密码必须至少包含六个字符 if not isinstance(pwd,str) or len(pwd)<6: return 'noot suitable for password' #密码强度等级与包含字符种类的对应关系 d = {1:'weak',2:'below middle',3:'above middle',4:'strong'} #分别用来标记pwd是否含有数字.小写字母.大写字母.指定的标点
//判断给定字符串是否是回文 function isPalindrome(word) { var s = new Stack(); for (var i = 0; i < word.length; i++) { s.push(word[i]); } var rword = ""; while (s.length()>0) { rword +
javascript 写一段代码,判断一个字符串中出现次数最多的字符串,并统计出现的次数 function test(){ var bt = document.getElementById("bt"); bt.addEventListener("click",function(){ var str = "dafdsjkfnaiesdaadsllllllkkkkk444444444444444"; var obj = []; // 存放结果集的数组