Python Intermediate Tutorial #6 - Queues

preview_player
Показать описание
In today's episode, we are talking about queues!

Subscribe and Like for more free content!
Рекомендации по теме
Комментарии
Автор

I love these tutorials, they are so helpful! Thank you

amulyalakshmisha
Автор

Very nice tutorials. I'm glad I found your channel.

youmnaification
Автор

Great job, very clear.. this is gonna be useful for my exams. Big up!

giacomofilippin
Автор

Helpful tutorial 👍
You are really underrated, you deserve more subs

rajdeepchakraborty
Автор

you are the best in this kind of tutos. please keep doing

cartf
Автор

Man, finally i found 1 tutorial that doesnt use a fucking list as an example. The whole purpose of queues is to use when a list isnt needed and yet EVERY SINGLE TUTORIAL uses a fucking list as an example

estudosapenas
Автор

The way you explained it and with the example you used really helped me understand. Thanks!

stayinfly
Автор

Can't we use stack for LIFO so why we use queue

harjyot
Автор

It help me a lot!, thank you so much and greetings from Argentina and i hope that you have a good day

juanmanuelimaz
Автор

So in other words LifoQueue is basically a stack...

jansz
Автор

Why can't we use deque or heap? Is queue any better than those two?

lzsuvuz
Автор

when ı write the same code, the result is 10, 20, 30, 40... get method gives all of the numbers, not just the first. I dont understand what is the problem

orion
Автор

This channel is awesome. I follow you on Instagram

rohitg
Автор

from queue import Queue, LifoQueue, PriorityQueue

q = Queue() #FIFO
s = LifoQueue() #LIFO
pq = PriorityQueue()

nums = [1, 2, 3, 4, 5]

for num in nums:
q.put(num) #queue

for num in nums:
s.queue.append(num) #stack

pq.put((3, "Hello")) # tuple typecasting.
pq.put((1, "World"))
pq.put((2, "!"))

print(q.get())
print(s.queue.pop())
print(pq.get())
# print(pq.queue.pop())

print(q.queue) #output
print(s.queue)
print(pq.queue)

kvelez