Python

python에서 스택, 큐 사용

Real_G 2007. 5. 25. 02:16
반응형

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Administrator>python
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> s=[10,20,30,40]
>>> s.append(50)
>>> s
[10, 20, 30, 40, 50]
>>> s.append(60)
>>> s
[10, 20, 30, 40, 50, 60]
>>> s.pop()
60
>>> s
[10, 20, 30, 40, 50]
>>> s.pop()
50
>>> s
[10, 20, 30, 40]
>>>>>> s.pop(0)
10
>>> s
[20, 30, 40]
>>>

반응형