2018-7-7-Python练习

 7个基本掌握

join

split

find

strip

upper

lower

replace

进阶掌握

索引

切片

len

range

test = "abcdeabcfg"
v = test[4]
print(v)
w =  test[0:3]
print(w)
x = len(test)
print(x)

for循环

#while冗长,for的精简
test = "我是一个卧底"
# index = 0
# while index < len(test):
# v = test[index]
# print(v)
# index += 1
for i in test:
print(i)

猜你喜欢

转载自www.cnblogs.com/lylyfly/p/9276277.html