- 3

#! python # Using Lists as Queues queue = ["Eric", "John", "Michael"] queue.append("Terry") # Terry arrives queue.append("Graham") # Graham arrives print queue s=queue.pop(0) print s s=queue.pop(0) print s print queue

20th Jul 2017, 2:01 PM
paul mwengei
paul mwengei - avatar
4 Answers
+ 1
Here you go: queue = ["Eric", "John", "Michael"] queue.append("Terry") queue.append("Graham") print (queue) s=queue.pop(0) print (s) s=queue.pop(0) print (s) print (queue)
12th May 2018, 7:57 PM
$¢𝐎₹𝔭!𝐨𝓝
$¢𝐎₹𝔭!𝐨𝓝 - avatar
+ 1
more multiple line comment you can use ''' or """
12th May 2018, 7:58 PM
$¢𝐎₹𝔭!𝐨𝓝
$¢𝐎₹𝔭!𝐨𝓝 - avatar
0
idenotation is more important in python
12th May 2018, 7:57 PM
$¢𝐎₹𝔭!𝐨𝓝
$¢𝐎₹𝔭!𝐨𝓝 - avatar
0
# sign is used for single line comment
12th May 2018, 7:58 PM
$¢𝐎₹𝔭!𝐨𝓝
$¢𝐎₹𝔭!𝐨𝓝 - avatar