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
>---
>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
>
>hey i dont know if this is the right place but i was just coding in idle and
>kept getting this syntax error and i can not see m to fix it here is my bit of
>code:
> if age == my_age:
> print("i'm",age,"too")
> else:
> if age < 14:
> print(" i'm older
Hi Oliver,
Your else statement should be unindented by one level ;-)
The else must be at same indent level as the if it belongs to.
BR,
George
2016-12-11 17:30 GMT+01:00 oliver patterson <
oliverjamespatter...@hotmail.com>:
> hey i dont know if this is the right place but i was just coding in i
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
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