您好,登錄后才能下訂單哦!
# -*- 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."
查詢的表:聲明。電話號都是隨便打的:
執(zhí)行結(jié)果:
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。