字符串操作

idno ='440000199804024147'
地区=idno[0:6]
生日=idno[6:14]
性别=idno[-2]
print(地区,生日,性别)
if(int(性别) % 2 == 0):
    print('girl')
else:
    print('boy')

for i in range(12):
    print(9800+i,chr(9800+i))


s=input('明文:')
for c in s:
    print(chr(ord(c)+3),end='')

s=input('\n密文:')
for c in s:
    print(chr(ord(c)-3),end='')

 

posted @ 2018-05-23 21:21  赵敏婷  阅读(126)  评论(0)    收藏  举报