Determine whether three sides form a valid triangle, and classify the triangle
Add a __name__ == &quot;__main__&quot; guard, and move the logic into a function separate from the I/O:
def triangle_type(a, b, c):
    '''Return a string indicating the type of triangle
       (Equilateral, Isosceles, Scalene, Impossible)
    '''
    # implementation here...

def main():
    getcontext().prec = 3
    getcontext().rounding = ROUND_HALF_UP

    #Needs to be divided to re-set decimal place I think
    a = Decimal(input(&quot;Length of side a = &quot;)) / 1
    b = Decimal(input(&quot;Length of side b = &quot;)) / 1
    c = Decimal(input(&quot;Length of side c = &quot;)) / 1

    print(f&quot;This is a {triangle_type(a, b, c)} triangle&quot;)

if __name__ == &quot;__main__&quot;:
    main()

In the implementation, we can save a lot of &quot;or&quot; tests by sorting the lengths before we start:
a, b, c = sorted([a, b, c])

if a + b &lt;= c:
    # N.B. automatically catches a &lt; 0, since b &lt;= c
    return 'Impossible'
if a != b != c:
    return 'Scalene'
elif a == c:
    return 'Equilateral'
else:
    return 'Isosceles'


Modified code
def triangle_type(a, b, c):
    '''
    Return a string indicating the type of triangle
    (Equilateral, Isosceles, Scalene, Impossible)
    '''

    a, b, c = sorted([a, b, c])

    if a + b &lt;= c:
        return 'Impossible'
    if a != b != c:
        return 'Scalene'
    if a == c:
        return 'Equilateral'
    return 'Isosceles'
    
def main():
    a = input(&quot;Length of side a: &quot;)
    b = input(&quot;Length of side b: &quot;)
    c = input(&quot;Length of side c: &quot;)
    print(f&quot;({a}, {b}, {c}) is a {triangle_type(a, b, c)} triangle&quot;)

if __name__ == &quot;__main__&quot;:
    main()


Further improvement
Use the doctest module to write the tests:
def triangle_type(a, b, c):
    '''
    Return a string indicating the type of triangle
    (Equilateral, Isosceles, Scalene, Impossible)

    &gt;&gt;&gt; triangle_type(1, 1, 2)
    'Impossible'
    &gt;&gt;&gt; triangle_type(-1, -1, -1)
    'Impossible'
    &gt;&gt;&gt; triangle_type(1, 1.0, 1)
    'Equilateral'
    &gt;&gt;&gt; triangle_type(1, 2, 2)
    'Isosceles'
    &gt;&gt;&gt; triangle_type(2, 3, 2)
    'Isosceles'
    &gt;&gt;&gt; triangle_type(2, 3, 4)
    'Scalene'
    '''

    a, b, c = sorted([a, b, c])

    if a + b &lt;= c:
        return 'Impossible'
    if a != b != c:
        return 'Scalene'
    if a == c:
        return 'Equilateral'
    return 'Isosceles'

if __name__ == &quot;__main__&quot;:
    import doctest
    doctest.testmod()