如何使用Python获取for
中的第一个字符?你知道吗
假设我们有number = ['078 823 42', '021 932 02']
For num in number:
-获取开头带有07的数字并打印出来。你知道吗
如果我用这个:
if num[0:2] == '07':
print(datas.append(num.string))
我得到这个错误TypeError: unhashable type: 'slice'
我正在使用python3.3和beautifulsoup
Tags:
只需使用slicing获取每个字符串的前两个字符。你知道吗
相关问题 更多 >
编程相关推荐