[Tutor] Created Function, Need Argument to be a String

2016-12-14 Thread Bryon Adams
Is there a way to force my argument to always be a string before entering the function? Else, is there a better way to go about this? In whatever program I write, I could change what I want as input to be a string prior to tossing it into the function but I think it would make more sense for my

Re: [Tutor] Parsing a String

2016-11-25 Thread Bryon Adams
On 11/25/2016 05:26 PM, Bryon Adams wrote: Hello, I have written a script that pulls certain bits of information out of a Cisco router's 'show version' command. The output is given in the assignment and it does work on several different routers (I tested 3 different models fro

[Tutor] Parsing a String

2016-11-25 Thread Bryon Adams
Hello, I have written a script that pulls certain bits of information out of a Cisco router's 'show version' command. The output is given in the assignment and it does work on several different routers (I tested 3 different models from work). What I did seems a bit messy to me though, woul

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

[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

[Tutor] Question About the .format Method.

2016-11-09 Thread Bryon Adams
Hello, Working on a simple function to get an IP address and make it look pretty for the PyNet course. I'm wondering if there's way to evenly space text with the string.format() method similar to how I'm doing it with the % operator. The last two prints keep everything left aligned and 20

Re: [Tutor] Alternative to for/while loop

2016-10-25 Thread Bryon Adams
On 10/25/2016 4:31 AM, Wolfgang Maier wrote: On 25.10.2016 10:10, Ben Finney wrote: Bryon Adams writes: I'm very new to python so please forgive what may be a beginner question. Welcome! You are in the right place for asking beginner Python questions :-) I'm thinking there

Re: [Tutor] Alternative to for/while loop

2016-10-25 Thread Bryon Adams
On 10/25/2016 4:19 AM, Alan Gauld via Tutor wrote: On 25/10/16 02:38, Bryon Adams wrote: question. The book I'm working through hasn't covered using flow control yet so I'm thinking there should be a way to do this without the for loop I used, but I'm at a loss here. Th

[Tutor] Alternative to for/while loop

2016-10-25 Thread Bryon Adams
Hello, I'm very new to python so please forgive what may be a beginner question. The book I'm working through hasn't covered using flow control yet so I'm thinking there should be a way to do this without the for loop I used, but I'm at a loss here. So far the book has covered: lists, stri