您好,登錄后才能下訂單哦!
# -*- coding: utf-8 -*- while 1: name= raw_input("Please input your name:") if name == "zhangsan": password = raw_input("Please input your password:") while password != "zhangsan": password = raw_input("password error,Please input your password again:") else: print "Login successful." print "welcome to search address list." while 1: match_yes = 0 search = raw_input("please input name whom you want to search.") contact_file = file('address_list.txt') while 1: line = contact_file.readline() if len(line) == 0:break if search in line: print 'Congratulations:\n\n %s' % line match_yes = 1 if match_yes == 0: print "Sorry,not found" else: print "username error,try again."
查詢的表:聲明。電話號都是隨便打的:
執行結果:
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。