Re: [Tutor] Variable Question

2016-11-20 Thread Peter Otten
Bryon Adams wrote: > On 11/18/2016 08:16 PM, Alan Gauld via Tutor wrote: >> for index, item in enumerate(prefix): >> prefix[index] = item[1] >> >> > > I forgot about enumerate! That helped me clean up and actually finish my > next exercise as I was having trouble working for my lists the way

Re: [Tutor] Variable Question

2016-11-20 Thread Bryon Adams
On 11/18/2016 08:16 PM, Alan Gauld via Tutor wrote: for index, item in enumerate(prefix): prefix[index] = item[1] I forgot about enumerate! That helped me clean up and actually finish my next exercise as I was having trouble working for my lists the way I was previously. Thank you ver

Re: [Tutor] Variable Question

2016-11-18 Thread Alan Gauld via Tutor
On 18/11/16 21:00, Bryon Adams wrote: > Fedora 24. I take four strings and create a list of them. In my below > code, if I print out prefix and as_path, both give me the same Because they are the same. They are both references to entries. > included the output below). What causes this behavior?

[Tutor] Variable Question

2016-11-18 Thread Bryon Adams
Hello, Variable throwing me off in a script I'm running on Python3.5, on Fedora 24. I take four strings and create a list of them. In my below code, if I print out prefix and as_path, both give me the same (I included the output below). What causes this behavior? Is this just how Python is h