Advertisement
repente

Untitled

Oct 30th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. string = input()
  2. sub_str = input()
  3.  
  4. result = []
  5. res01 = string.find(sub_str)
  6. if res01 != -1:
  7. result.append(str(res01))
  8.  
  9. if result:
  10. start = res01
  11. temp = 0
  12. while True:
  13. start = start + 1
  14. res02 = string.find(sub_str, start)
  15. if res02 != -1:
  16. temp = res02
  17.  
  18. if res02 == -1:
  19. if temp != 0:
  20. result.append(str(temp))
  21. break
  22.  
  23. if result:
  24. print(" ".join(result))
  25. else:
  26. print("None"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement