You can "define variables" in the argument list. The problem is that the expression is only evaluated once, when the function is declared.
To give an example, in this interactive (IPython!) session I'm declaring two functions. Note that "Doing something" is only printed once, just as I declare test()
:
In [86]: def something():
....: print "Doing something"
....: return 10
....:
In [87]: def test(x=something()):
....: print "x is %s" % x
....:
Doing something
In [88]: test()
x is 10
In [89]: test()
x is 10
For the above reason, the following pattern is pretty common for default arguments in Python, try to use it in your function.
def foo(arg=None):
if arg is None:
arg = "default value" # In your case int(input(...))