Jump to content

boparai

Member
  • Posts

    6
  • Joined

  • Last visited

Awards

This user doesn't have any awards

About boparai

  • Birthday Aug 11, 1995

Profile Information

  • Gender
    Male

boparai's Achievements

  1. its the kind that arises when you don't access to write to the temp folder try running as administrator
  2. the first line is compiling a regular for later use. I'll explain piece by piece : r' ' : it for python raw strings for unconflicting regex [ ] : are selectors to specify which characters and/or range of characters to find A-Z: specify all upper case letters and a-z all lower case letters + : is a greedy meta-character which tells the regex engine to find 1 or more characters which match earlier criteria lets see an example :http://docs.python.org/2/howto/regex.html string = 'i_am doing**it ^&wrong 1234' and we're using findall so it will well find all parts of the string that match our regex and return a list list = ['i','am','doing','it','wrong'] and then join everything in the list with the blank string and return "iamdoingitwrong" Although it is a little bit complicated since you don't about regex much but it is a lot more safer and short and frankly it will far more easy when you learn about regex you can learn more about regex here : http://docs.python.org/2/howto/regex.html
  3. you would probably be better off using simple regex. Here : import redef only_alpha(text): regex = re.compile(r'[A-Za-z]+') ans = "".join(regex.findall(text)) return ans it should probably do it if you have any confusion about the regex just ask i'll explain it to you
  4. Python 3 is not the future or "FUTURE PROOF" and all the stuff it does can be done in python 2 as for the libraries most of them are compatible with both or can be made compatible by various means .
×