小编Mic*_*uts的帖子

学习Python Splits和Joins?

我以为我理解python中的分裂和连接,但它不适合我.

让我们说的价值 inp[17] = 'Potters Portland Oregon school of magic'

# a string of data I am pulling from a csv file, the data comes through just fine.
loc = inp[17] 

l = loc.split(' ') # I want to split by the space

# I want to filter out all these words say they don't always 
# come as "School of magic" so I cant just filter that out they 
# could be mixed around at times.

locfilter = ['Potters', …
Run Code Online (Sandbox Code Playgroud)

python split join list-comprehension python-2.7

1
推荐指数
1
解决办法
97
查看次数

标签 统计

join ×1

list-comprehension ×1

python ×1

python-2.7 ×1

split ×1