How do I complete this function?
<p>For your assignment you must write a compare function that returns 1 if a > b , 0 if a == b , and -1 if a &lt; b . The user must be prompted for the values of a and b. The compare function must have arguments for a and b. To demonstrate your compare function, you must call the compare function three times, once for each condition, from within your program and display (using print statement) the return code of the function.</p>

<p>This is what I have so far...</p>

<pre><code>#-----define the compare function
def compare(a,b):
    if (a == b):
        return 0
    elif (a &gt; b):
        return 1
    else:
        return -1
</code></pre>

<p>What do I do next?</p>

<p>For asking user for an input</p>

<ul>
<li>Use <code>input</code> function if you are using Python 3 </li>
<li>Use <code>raw_input</code> function for Python 2.x</li>
</ul>

<p>Convert the input into integer since the input values will be string.</p>

<p>Then call the compare function and get the value returned from compare function into variable and print it.</p>

<pre><code>def compare(a,b):
    if (a == b):
        return 0
    elif (a &gt; b):
        return 1
    else:
        return -1

x=input("Enter first number :")
y=input("Enter first number :")
z=compare(int(x),int(y))
print(z)
</code></pre>

<p>I hope this will be helpful.</p>

python