Question: What is the output produced as this code executes? pq = Queue ( ) x = 8 ; y = 2 0 ; pq .

What is the output produced as this code executes?
pq=Queue()
x =8; y =20;
pq.put(6);
pq.put(x);
pq.put(y);
print(pq.get(), end="")
y=pq.get();
pq.put(3*y);
pq.put(35);
while not(pq.empty()):
print(pq.get(), end="");
1.8202435
2.682024
3.6202435
4.682435

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!