fork download
  1. def remove_digit(num):
  2. to_remove = sorted(set(str(num)))[-2]
  3. print(type(num)(str(num).replace(to_remove, "")))
  4.  
  5. remove_digit(51235)
  6. remove_digit(13471346)
  7. remove_digit(12351.51)
  8. remove_digit(150913.1165)
  9. remove_digit(155556113.000)
  10. remove_digit(0.0)
  11. remove_digit(0.01)
  12. remove_digit(10)
Success #stdin #stdout 0.02s 9984KB
stdin
Standard input is empty
stdout
5125
1347134
1251.51
150913.115
16113.0
0.0
0.1
1