Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def replace_spaces(string):
- str_list = list(string)
- for x in range(len(str_list)): # this is O(n)
- if str_list[x] == ' ':
- str_list[x] = '%20'
- return ''.join(str_list)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement