【Python爬虫】-课后练习5

#1

#2

str1='http://www.jianshu.com/u/31a09b9ab717'

print(str1.split('/')[4])

#3

s="abcdefg"

print(s[3])

print(s[2:4])

print(s[:5])

print(s[3:])

print(s[::-1])

print(s[::2])

#4

list1= [1,2,3,4,5,6,7]

print(list1[3])

print(list1[2:4])

print(list1[:5])

print(list1[3:])

print(list1[::-1])

print(list1[::2])

#5

touple1=(1,2,3,4,5,6,7)

print(touple1[3])

print(touple1[2:4])

print(touple1[:5])

print(touple1[3:])

print(touple1[::-1])

print(touple1[::2])

你可能感兴趣的:(【Python爬虫】-课后练习5)