How to do the modulus calculation without using mod funct in Python
<p>I am coding in Python and using Putty, I couldnt find the right way to do a program that does a modulus calculation without the mod function. </p>

<pre><code>def main()

    Input1 = int(input("Type in first number"))
    Input2 = int(input("Type in second number"))

    q = (input1 / Input2)   #finding quotient (integer part only)
    p = (q * Input2)    //finding product
    m = (Input1 - p)    //finding modulus
    print(Input1, "%", Input2, "=", m)
main
</code></pre>

<pre><code>def main():

    Input1 = int(input("Type in first number"))
    Input2 = int(input("Type in second number"))

    q = (Input1 / Input2)
    for i in range(0, Input1, Input2):
        if Input1 - i &lt; Input2:
            print(Input1-i)
</code></pre>

<p>This is a way to find what x mod y is in any given circumstance.</p>

python