Rounds off numbers from 1 - 10, 000 including negatives I was trying to replicate Python's internal round() function. 
The program asks for a number, converts it into a float (catches the value error if present) and gets the absolute value of the float (to handle negative numbers). 

def rounder(): 
    number = input("Give me a number to round off!: \n")
    #Makes sure you enter a valid number
    try:
        floater = float(number)
        absol = abs(floater)
    except ValueError:
        print("Please enter a valid number.\n")
        starter()

    if absol &lt; 10 and absol &gt; 0: #Works for both 0.6 and 1.6 | Because 0.6 is too small for 1 and will return the rounding while 1.6 % == 0.6 also
        rounding = absol % 1
        if rounding &gt;= 0.5: #If more than 0.5
            absol += 1 #Increment It
            temp =(int(absol)) #Convert back to integer

            if floater &lt; 0: #Negative check
                print(-temp)
            else:
                print(temp)

        elif rounding &lt; 0.5:
            temp = (int(absol))

            if floater &lt; 0: #Negative check
                print(-temp)
            else:
                print(temp)

    elif absol &lt; 100 and absol &gt; 10: #use %10
        rounding = absol % 10
        rounding2 = rounding % 1
        if rounding2 &gt;= 0.5: #If more than 0.5
            absol += 1 #Increment It
            temp = (int(absol)) #Convert back to integer

        if floater &lt; 0: #Negative check
            print(-temp)
        else:
            print(temp)

    elif rounding2 &lt; 0.5:
        temp = (int(absol))

        if floater &lt; 0: #Negative check
            print(-temp)
        else:
            print(temp)
    rounder()

def starter():
    print("Compatible from 0.1 - 9999.9") 
    rounder()       

starter()


It keeps on going like that until if absol &lt; 10000 and absol &gt; 1000 . Also the number of modulo operations (%) it goes through increases.

The ranges are hard-coded so it can only handle numbers from 1 - 10 000. I could manually increase the limitation if I wanted but I would have to keep doing that until infinity. 


Does anyone have any idea on how to get beyond this limitation?
Can my code be refined? Is there a more efficient way of doing this?


Keep all answers beginner-friendly.
min &lt; value &lt; max

Python makes this kind of conditions really easy:


if absol &lt; 10 and absol &gt; 0:



Like this:

if 0 &lt; absol &lt; 10:


Don't repeat yourself

Instead of this:

    if floater &lt; 0: #Negative check
        print(-temp)
    else:
        print(temp)

    # ...

    if floater &lt; 0: #Negative check
        print(-temp)
    else:
        print(temp)


Create a helper function:

def abs(num):
    if num &lt; 0:
        return -num
    return num