Inflearn brand logo image

Inflearn Community Q&A

sgh41332526's profile image
sgh41332526

asked

Getting Started with Programming: Introduction to Python (Inflearn Original)

Dictionary (5-2)

pop

Written on

·

226

0

리스트에서는 마지막원소를 꺼내올때 pop을 썼는데

딕셔너리에서는 popitem을 쓰네요 !!

>>> 딕셔너리에서는 마지막원소(임의의 원소)를 꺼내올때 리스트와 달리 popitem을 쓰는 거죠? 

>>> 그리고 pop() 괄호안에는 value는 안되고.. key만 입력이 가능하죠?? 

python

Answer 1

1

niceman님의 프로필 이미지
niceman
Instructor

The syntax of pop() method is

dictionary.pop(key[, default])

레퍼런스 확인해보세요.
sgh41332526's profile image
sgh41332526

asked

Ask a question