i want to get the sum of deque in python. help me

Viewed 14
queue1 = [3, 2, 7, 2]
queue2 = [4, 6, 5, 1]

cnt = 0
sum_queue = sum(queue1+ queue2) // 2

queue1 = deque([queue1])
queue2 = deque([queue2])

I want to get the sum of deques over and over again. Is there a function or method to get the sum of the elements of a deque?

0 Answers
Related