Advertisement
Guest User

Untitled

a guest
Oct 19th, 2014
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.18 KB | None | 0 0
  1. def replace_spaces(string):
  2.     str_list = list(string)
  3.     for x in range(len(str_list))# this is O(n)
  4.         if str_list[x] == ' ':
  5.             str_list[x] = '%20'
  6.  
  7.     return ''.join(str_list)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement