Guest User

Untitled

a guest
Jul 19th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. def repeatedString(s, n):
  2. converged = s*n
  3. got_it = converged[0:n]
  4. count = 0
  5. for x in got_it:
  6. if "a" in x:
  7. count += 1
  8. return count
  9. s = input()
  10. n = int(input())
  11. result = repeatedString(s, n)
  12. print(result)
  13.  
  14. a
  15. 1000000000000
  16.  
  17. Traceback (most recent call last):
  18. File "programs.py", line 11, in <module>
  19. result = repeatedString(s, n)
  20. File "programs.py", line 2, in repeatedString
  21. converged = s*n
  22. MemoryError
Add Comment
Please, Sign In to add comment