1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | # # µû¶óÇÏ¸ç ¹è¿ì´Â ÆÄÀ̽ã°ú µ¥ÀÌÅÍ°úÇÐ(»ý´ÉÃâÆÇ»ç 2020) # LAB 8-2 ¿µÇÑ »çÀüÀ» ¸¸µé¾î º¸ÀÚ, 205ÂÊ # print("»çÀü ÇÁ·Î±×·¥ ½ÃÀÛ... Á¾·á´Â q¸¦ ÀÔ·Â") dictionary = {} while True: st = input('$ ') command = st[0] # ù ÀÔ·Â ¹®ÀÚ¸¦ ÃßÃâÇÑ´Ù if command == '<': st = st[1:] inputStr = st.split(':') if len(inputStr) < 2 : print('ÀÔ·Â ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù.') else: dictionary[inputStr[0].strip()] = inputStr[1].strip() elif command == '>': st = st[1:] inputStr = st.strip() if inputStr in dictionary: print(dictionary[inputStr]) else : print('{}°¡ »çÀü¿¡ ¾ø½À´Ï´Ù.'.format(inputStr)) elif command == 'q': break else : print('ÀÔ·Â ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù.') print("»çÀü ÇÁ·Î±×·¥À» Á¾·áÇÕ´Ï´Ù.") | cs |