凌乱美

Limei
231 号测试 成员, 2018-11-23 02:55:51 加入
2.1k
个人主页浏览
  • Python13 期字符串大考核!!!

    2020-07-24 10:55

    s="sdSdsfdAdsdsdfsfdsdASDSDFDSFa"
    print(s.upper())
    print(s.lower())
    print(s.swapcase())

    print("替换前:",s)
    s_1=s.replace('s','h')
    s_2=s_1.replace('S','H')
    s_3=s_2.replace('f','u')
    s_4=s_3.replace('A','Z')
    s_5=s_4.replace('D','W')
    s_6=s_5.replace('F','U')
    s_7=s_6.replace('d','w')
    s_8=s_7.replace('a','z')
    print("替换后:",s_8)