~ ~ ~ ~ 연습 ~ ~ ~ 길 묻 기 프로그램

person=['B','C','D','E']
know=False
def askway(address):
    #  
    if len(person)>0 and know is False:
        name=person.pop()
        def ask():
            print('%s,   %s    ?'%(name,address))
            answer=input()
            if answer=='Y':
                know=True
                answer_address=input('       ')
                print('%s  %s   ,   %s'%(name,address,answer_address))
            else:
                print('%s   ,       '%name)
                askway(address)
        ask()
    else:
        print('     ')
x='nanjing'        
askway(x)    

 
다음으로 전송:https://www.cnblogs.com/haoy/p/10271147.html

좋은 웹페이지 즐겨찾기