Correct approach for calling a function regardless of parameter type
<p>I have a program that prints multiplication tables. </p>

<pre><code>def print_tables(input):
    for i in xrange(1,11):
        print "%s x %s = %s" %(input, i, input*i)

user_input = raw_input("What do you want multiplied ten fold? ")

if(user_input.isdigit()):
    print_tables(int(user_input))

else:
    print_tables(user_input)
</code></pre>

<p>If the user enters a string <code>"a"</code>, I would expect the output to be:</p>

<pre><code>a x 1 = a
a x 2 = aa
a x 3 = aaa
a x 4 = aaaa
a x 5 = aaaaa
a x 6 = aaaaaa
a x 7 = aaaaaaa
a x 8 = aaaaaaaa
a x 9 = aaaaaaaaa
a x 10 = aaaaaaaaaa
</code></pre>

<p>Calling the <code>print_tables</code> function in both the <code>if</code> and <code>else</code> blocks does feel a bit redundant to me. </p>

<p>Is there a better way in Python to call the <code>print_tables</code> function regardless of the parameter type?</p>
