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

2016-12-17 Thread Juan C.
On Mon, Dec 12, 2016 at 2:29 PM, Bryon Adams wrote: > Is there a way to force my argument to always be a string before entering > the function? You could do the following: 1. Use `def ip_checker(ip_address: str):` to make it more clear that you're expecting a str, but remember, this is just a "h

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

2016-12-17 Thread Joaquin Alzola
>--- >Error from interpreter: (looks like it's taking issue with it being a >number it doesn't know how to deal with) > ip_checker(169.254.0.1) > File "", line 1 > ip_checker(169.254.0.1) >^ >SyntaxError: invalid syntax >

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

2016-12-17 Thread Matt Williams
Use the str() function. M On Thu, 15 Dec 2016, 07:56 Bryon Adams, wrote: > 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

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

2016-12-17 Thread George Fischhof
2016-12-12 17:29 GMT+01:00 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 functi

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

2016-12-16 Thread Sibylle Koczian
Am 12.12.2016 um 17:29 schrieb 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 b