def remove_digit(num):
to_remove = sorted(set(str(num)))[-2]
print(type(num)(str(num).replace(to_remove, "")))
remove_digit(51235)
remove_digit(13471346)
remove_digit(12351.51)
remove_digit(150913.1165)
remove_digit(155556113.000)
remove_digit(0.0)
remove_digit(0.01)
remove_digit(10)
ZGVmIHJlbW92ZV9kaWdpdChudW0pOgoJdG9fcmVtb3ZlID0gc29ydGVkKHNldChzdHIobnVtKSkpWy0yXQoJcHJpbnQodHlwZShudW0pKHN0cihudW0pLnJlcGxhY2UodG9fcmVtb3ZlLCAiIikpKQoJCnJlbW92ZV9kaWdpdCg1MTIzNSkKcmVtb3ZlX2RpZ2l0KDEzNDcxMzQ2KQpyZW1vdmVfZGlnaXQoMTIzNTEuNTEpCnJlbW92ZV9kaWdpdCgxNTA5MTMuMTE2NSkKcmVtb3ZlX2RpZ2l0KDE1NTU1NjExMy4wMDApCnJlbW92ZV9kaWdpdCgwLjApCnJlbW92ZV9kaWdpdCgwLjAxKQpyZW1vdmVfZGlnaXQoMTAp