myid='4401178199705094322'
age=2018-int(myid[6:10])
if int(myid[-2])%2==0:
sex='girl'
else:
sex='boy'
print(age,sex)
#用字符串表示自己的学号,分隔出年级、专业、班级、序号
s ='201606050054'
a=s[:4]
b=s[4:6]
c=s[6:8]
d=s[8:]
if s[4:6]=="06":
area="信息技术与工程学院"
print('年级{}'.format(a))
print('学院{}'.format(area))
print('班级{}'.format(c))
print('学号{}'.format(d))
![](https://images2018.cnblogs.com/blog/1482909/201809/1482909-20180913113839363-1803932799.png)
#字符串的:连接,重复,in判断
a='girl'
b='5'
print(a+b)
print(a*3)
print('girl'in a+b)
![](https://images2018.cnblogs.com/blog/1482909/201809/1482909-20180913114003205-1246915806.png)
#用for循环产生一系列网址
for i in range(2,10):
print("http://news.gzcc.cn/html/2018/xiaoyuanxinwen/{}.html".format(i));
![](https://images2018.cnblogs.com/blog/1482909/201809/1482909-20180913114119034-40963565.png)