首页 > 编程语言 > 详细

2018-7-7-Python练习

时间:2018-07-07 10:05:19      阅读:146      评论:0      收藏:0      [点我收藏+]

 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)

 

2018-7-7-Python练习

原文:https://www.cnblogs.com/lylyfly/p/9276277.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!