fork download
  1. # your code goes here
  2.  
  3.  
  4. x = "dfgjj j d6f76 667d 6d66 66 df6 g5d5d 499d fg&^&^ &^76( 787 66 6 7 78 888 90 19"
  5.  
  6. y = []
  7. temp_i = 0
  8. temp = ''
  9.  
  10. temp_i = 0
  11. while (True):
  12. if temp_i > len(x) - 1:
  13. break
  14. elif x[temp_i].isdigit():
  15. while x[temp_i].isdigit():
  16. temp += x[temp_i]
  17. if temp_i >= len(x) - 1:
  18. break
  19. temp_i += 1
  20. y.append(int(temp))
  21. if temp_i >= len(x) - 1:
  22. break
  23. temp = ''
  24. else:
  25. temp_i += 1
  26.  
  27.  
  28. print (y)
Success #stdin #stdout 0.01s 9992KB
stdin
Standard input is empty
stdout
[6, 76, 667, 6, 66, 66, 6, 5, 5, 499, 76, 787, 66, 6, 7, 78, 888, 90, 19]