-
Python13 期字符串大考核!!!
2020-07-24 10:55a="sdSdsfdAdsdsdfsfdsdASDSDFDSFa"
print(a.swapcase())
b=a.swapcase()
new_str=''for i in b:
if i.islower():
i=chr(219-ord(i))
new_str += i
elif i.isupper():
i=chr(155-ord(i))
new_str +=i
print( new_str)
a="sdSdsfdAdsdsdfsfdsdASDSDFDSFa"
print(a.swapcase())
b=a.swapcase()
new_str=''
for i in b:
if i.islower():
i=chr(219-ord(i))
new_str += i
elif i.isupper():
i=chr(155-ord(i))
new_str +=i
print( new_str)