fork download
  1. a = ["1", "2", "привет", "3", "привет", "123", "1e2", "-9", "-3007", "-9.7"]
  2. a = [int(x) if x.isdigit() or x[0]=='-' and x[1:].isdigit() else x for x in a]
  3. print(a)
Success #stdin #stdout 0.02s 9348KB
stdin
Standard input is empty
stdout
[1, 2, 'привет', 3, 'привет', 123, '1e2', -9, -3007, '-9.7']