#!/usr/local/bin/pythonstr1 = "xuerui"str2 = "xueruihao"if str1 in str2: print "yes"else: print "no"
使用成员检查符 in .>>> a = 'xuexi'>>> b = 'xuexihao'>>> a in bTrue
xuexi in xuexihao