针仙 2021-11-13 18:24 采纳率: 33.3%
浏览 31

判断字符是否含有完全相同的字母

img

  • 写回答

1条回答 默认 最新

  • Hann Yang 全栈领域优质创作者 2021-11-13 19:15
    关注
    def compare(str1,str2):
        Low = lambda s:s.lower().replace(' ','')
        if Low(str1)==Low(str2):
            print('YES')
        else:
            print('NO')
    
            
    >>> exam = '''Thisisapencil
      thisis an apple'''
    >>> string = exam.split('\n')
    >>> compare(string[0],string[1])
    NO
    >>> exam = '''Thisisapencil
      thisis a pencil'''
    >>> string = exam.split('\n')
    >>> compare(string[0],string[1])
    YES
    >>> 
    
    
    评论

报告相同问题?

问题事件

  • 创建了问题 11月13日

悬赏问题

  • ¥20 python忆阻器数字识别
  • ¥15 无法输出helloworld
  • ¥15 高通uboot 打印ubi init err 22
  • ¥20 PDF元数据中的XMP媒体管理属性
  • ¥15 R语言中lasso回归报错
  • ¥15 网站突然不能访问了,上午还好好的
  • ¥15 有没有dl可以帮弄”我去图书馆”秒选道具和积分
  • ¥15 semrush,SEO,内嵌网站,api
  • ¥15 Stata:为什么reghdfe后的因变量没有被发现识别啊
  • ¥15 振荡电路,ADS仿真