Chocolate Chip Cookie
본문 바로가기
Python

파이썬 예제 : 딕셔너리 활용 검색

by Khookie 2021. 6. 20.
stock = {'삼성에스디에스' : 242000 , '삼성전자' : 47000, '엔씨소프트' : 52600 , '핸디소프트' : 5120, '골프존' : 215000, '기아' : 56300}

while True :
    choose =input('주식 이름 ? ')
    if choose in stock:
        print( choose,' : ',stock[choose] )
        print()
    else:
        break

print('주식 이름이 없습니다.')

'Python' 카테고리의 다른 글

파이썬 이용 크롤링  (0) 2021.08.08
파이썬의 프레임워크 종류  (0) 2021.05.08

댓글