1. 首页
  2. 数据库
  3. 其它
  4. 使用python实现strcmp函数功能示例

使用python实现strcmp函数功能示例

上传者: 2020-12-31 16:53:47上传 PDF文件 22.88KB 热度 26次
实现这个功能我相信大家一定明白他的意思了,很简单了,下面的代码大家参考使用吧复制代码 代码如下:def strcmp(str1,str2): i = 0 while i<len(str1) and i<len(str2): outcome = cmp(str1[i],str2[i]) if outcome: print outcome return outcome i +=1
下载地址
用户评论