1. 程式人生 > >2018-7-7-Python練習

2018-7-7-Python練習

cfg str 掌握 abcd per col test clas repl

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練習