-
Python13 期字符串大考核!!!
2020-07-24 10:55c='sdSdsfdAdsdsdfsfdsdASDSDFDSFa'
print(c.swapcase())
new_c=''
for i in c:
if i.islower():
i=chr(219-ord(i))
new_c += i
elif i.upper():
i=chr(155-ord(i))
new_c += i
print(new_c)结果:
SDsDSFDaDSDSDFSFDSDasdsdfdsfA
hwHwhuwZwhwhwuhuwhwZHWHWUWHUz