How to writing a "if/unless" for an integer variable : I am trying to write a conditional where if a ends in 1 then it will answer with "st root" unless it ends with an 11 so it will be like 1st root or 11th root
(Then also work in similar ways for 2/12 and 3/13)

Here is the code I have tried

        def n():
          print("Only enter whole numbers\n ")
          base = float(input("Enter number to take the root of, then hit enter:\n "))
          input_string = input("Enter degree of roots (if more than one, separate by space) then hit enter:\n ")
          list  = input_string.split()
          a = 1
          for num in list:
              base **= (1/float(num))
          for num in list:
              a *= int(num)
          if str(a)[-1] == '1':
            if str(a)[-1] != '11':
              print(a,"st root",base) 
          elif str(a)[-1] == '2':
            if str(a)[-1] != '12':
              print(a,"nd root",base)
          elif str(a)[-1] == '3':
            if str(a)[-1] != '13':
              print(a,"rd root",base)
          else: 
            print(a,"th root",base)
        n()