字符串及其操作,字符的Unicode编码

时间:2020-12-21 20:18:37
stuNum = '201709080010'

print('年级是:'+stuNum[0:4])
print('专业编号是:'+stuNum[4:8])
print('序号是:'+stuNum[-3:])

字符串及其操作,字符的Unicode编码

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

字符串及其操作,字符的Unicode编码

plainText = input('message:')
for c in plainText:
    print(chr(ord(c)+3),end='')

字符串及其操作,字符的Unicode编码

id = '440105199812137813'
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')

字符串及其操作,字符的Unicode编码