# 변하지 않는 자료
tuple = (10, 20, 30)
()
(1,)
print(tuple[1])
print(tuple[0:2])
print(len(tuple))

# Key & Value 서로 짝이 있는 자료
dict = {'apple': '사과'}
print(dict['apple'])
#딕셔너리 추가
dict['banana'] = '바나나'
print(dict)
#딕셔너리 삭제
del dict['banana']
print(dict)

#key만 출력하기
dict2 = {'노트북': 15, '컴퓨터': 4, '연필': 20, 'TV': 5}
print(dict2.keys())
#value만 출력하기
print(dict2.values())

m = 0
m_k = ''
for k, v in dict2.items():
    if v > m:
        m = v
        m_k = k

print(dict2[m_k])
    

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: