def calculate(dealStr):
chgStr = ''
for index,currentCh in enumerate(dealStr):
if index == 0:
firstCh = dealStr[0]
if ord(firstCh) > 90 :
# 字母为小写字母转大写字母
ch = ord(firstCh) - 32
chgStr += chr(ch)
else:
chgStr += firstCh
else:
firstCh = dealStr[index]
if ord(firstCh) <= 90 :
# 字母为大写字母转小写字母
ch = ord(firstCh) + 32
chgStr += chr(ch)
else:
chgStr += firstCh
return chgStr
l1 = ['ajdM', 'DjfDi', 'jfhHLLp', 'heIIIl']
l2 = list(map(calculate, l1))
print(l2)