完整语句如下
name = 'Swaroop' # This is a string object
if name.startswith('Swa'):
print 'Yes, the string starts with "Swa"'
if 'a' in name:
print 'Yes, it contains the string "a"'
if name.find('war') != -1:
print 'Yes, it contains the string "war"'
delimiter = '_*_'
mylist = ['Brazil', 'Russia', 'India', 'China']
print delimiter.join(mylist)
刚学python,望各位大神指点一下
后面加的!=-1是啥意思,又是啥!=-1
那后面的!=-1有啥用,前面的应该就成立了吧,上面那个是我从书中复制出来的
本回答被提问者和网友采纳