码迷,mamicode.com
首页 > 其他好文 > 详细

字符串操作

时间:2018-05-23 22:11:23      阅读:189      评论:0      收藏:0      [点我收藏+]

标签:inf   操作   put   字符   else   串操作   src   col   int   

id = 441621199811026414
area = id[0:6]
birthday = id[6:14]
sex = id[-2]

print(area,birthday,sex)

if (int(sex) % 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(密文:)
for c in s:
    print(chr(ord(c)-3),end=‘‘)

技术分享图片

 

字符串操作

标签:inf   操作   put   字符   else   串操作   src   col   int   

原文地址:https://www.cnblogs.com/kidmarshall/p/9079390.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!