#coding:utf-8 def demo(data,temp): for i in range(len(data)-1): if data[i] == temp : print i break else: print u'没有满足条件的数字' if __name__ == "__main__": data,temp = [1,2,34,5],1 demo(data,temp)