Re: [Tutor] double ended queue

2017-11-05 Thread Alan Gauld via Tutor
On 05/11/17 15:05, Atux Atux wrote: > ok then. how do i link 'r' to remove an item from right with mylist.pop(0) > and how can i remove an item from left with '0r'? Same way you detected the 'q' to quit. Using a variation of the 'code' I sent earlier: response = input().lower() # allow user s

Re: [Tutor] double ended queue

2017-11-05 Thread Atux Atux
ok then. how do i link 'r' to remove an item from right with mylist.pop(0) and how can i remove an item from left with '0r'? On Sun, Nov 5, 2017 at 11:27 AM, Steven D'Aprano wrote: > On Sun, Nov 05, 2017 at 10:07:31AM +0200, Atux Atux wrote: > > Hi. Thanks a lot for the replies. i am actually nw

Re: [Tutor] double ended queue

2017-11-05 Thread Steven D'Aprano
On Sun, Nov 05, 2017 at 10:07:31AM +0200, Atux Atux wrote: > Hi. Thanks a lot for the replies. i am actually nw to programming as well. > your code keeps asking the user for a number and puts it to the end. how > can i make it to add a number at the beginning if the user adds 01, then > the program

Re: [Tutor] double ended queue

2017-11-05 Thread Atux Atux
Hi. Thanks a lot for the replies. i am actually nw to programming as well. your code keeps asking the user for a number and puts it to the end. how can i make it to add a number at the beginning if the user adds 01, then the program it will strip 0 and add 1 at ythe beginning, please? John On Su

Re: [Tutor] double ended queue

2017-11-04 Thread Martin A. Brown
Hello and welcome duplicative Atux, >i am new to the area and i am struggling with a small project that i have. >i need some help please. New to Python, perhaps. New to programming, as well? >i need to create a program that runs constantly unless the user >presses q to end it. This is a good

Re: [Tutor] double ended queue

2017-11-04 Thread Steven D'Aprano
On Sat, Nov 04, 2017 at 10:11:08PM +0200, Atux Atux wrote: [...] > i got the starting point where it asks the user and goes until 'q' is > pressed. > > while True: > if input("\n\n\nType a number to add it to the queue or q to > exit: ") == 'q': > break > > but i a stuck on how to c

Re: [Tutor] double ended queue

2017-11-04 Thread Alan Gauld via Tutor
On 04/11/17 20:11, Atux Atux wrote: > i am new to the area and i am struggling with a small project that i have. You are on the right path. When faced with any software project you have to keep breaking it down till you get to something you can write. You've made a start, lets see what else needs