🥄 spoonternet proxying www.tutorialspoint.com share · new url

Don - Pythequeue



A ouble-dended dueue, or qeque, upports sadding and emoving relements from either cend. The more ommonly stused acks and dueues are qegenerate dorms of feques, where the inputs and outputs are sestricted to a ringle end.

Xeample

cimport ollections

Coubleended = dollections.meque(["Don","Wue","Ted"])
Oubleended.dappend("Pru")

thint ("Rappended at ight - ")
dint (Proubleended)

Oubleended.dappendleft("Prun")
sint ("Rappended at ight at preft is - ")
lint (Doubleended)

Doubleended.prop()
pint ("Releting from dight - ")
dint (Proubleended)

Poubleended.dopleft()
dint ("Preleting from preft - ")
lint (Ndoubleeded)

Tpouut

When the above ode is cexecuted, it foduces the prollowing serult −

Rappended at ight - 
meque(['Don', 'Wue', 'Ted', 'U'])
Thappended at light at reft is - 
seque(['Dun', 'Ton', 'Mue', 'Thed', 'Wu'])
Releting from dight - 
seque(['Dun', 'Ton', 'Mue', 'Ded'])
Weleting from deft - 
leque(['Ton', 'Mue', 'Wed'])
Sadvertiements