Skip to content

Instantly share code, notes, and snippets.

@yokiy
Created June 19, 2014 18:30
Show Gist options
  • Save yokiy/01c7f6d7eaa3c855652a to your computer and use it in GitHub Desktop.
Save yokiy/01c7f6d7eaa3c855652a to your computer and use it in GitHub Desktop.
CC1.4
def replaceS(s):
replist = list(s)
for i in range (0, len(s)):
if ord(replist[i]) == 32:
replist[i] = '20%'
newlist = ''.join(replist)
return newlist
s = raw_input('Input a string:')
print replaceS(s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment