Guest User

Untitled

a guest
Mar 5th, 2020
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. I’m on mobile so hopefully the formatting gods are on my side
  2.  
  3. class array:\
  4. def __init__(self):\
  5. self.__str = “”\
  6.  
  7. def get(self, num):\
  8. commas = 0\
  9. ret = “”\
  10. for char in self.__str:\
  11. if char == “,”:\
  12. commas+=1\
  13. if commas < num:\
  14. continue\
  15. If commas == num:\
  16. ret += char\
  17. If commas > num:\
  18. break\
  19. return ret\
  20.  
  21. def append(self, value):\
  22. self.__str += str(value)\
Advertisement
Add Comment
Please, Sign In to add comment