Advertisement
Guest User

jamesl.py

a guest
Jan 11th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. def main():
  2.  
  3.     sLine=input("Enter a string to jamesl'ify it:\n")
  4.     sLine = sLine+" "
  5.     sOut=""
  6.     arrPunc = ["\'","\"",";",":","(",")","<",">","!","@","#","$","%","^","&","*","+","=","`","~","/","\\","{","}","[","]","|","_","-"]
  7.  
  8.     for k in range(len(sLine)):
  9.  
  10.         if (sLine[k] in arrPunc):
  11.             sOut+="jamesl"+sLine[k]
  12.         elif (sLine[k] == " "):
  13.             sOut+="jamesl"
  14.             if k+1<len(sLine):
  15.                 if not(sLine[k+1] in arrPunc):
  16.                     sOut+=" "
  17.                 else:
  18.                     continue
  19.         else:
  20.             continue
  21.  
  22.     print(sOut)
  23.  
  24. if __name__=="__main__":
  25.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement