Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def removeAlpha_for(seqch):
- # @param seqch: String
- # return string
- new_string = ""
- for s in range(len(seqch)):
- if not seqch[s].isalpha():
- new_string +=seqch[s]
- return new_string
- def removeDigit_for(seqch):
- # @param seqch: String
- # return string
- new_string = ""
- for s in range(len(seqch)):
- if not seqch[s].isalpha():
- new_string += seqch[s]
- return new_string
- def removeAlpha_while(seqch):
- # @param seqch: String
- # return string
- s = 0
- new_string = ""
- while s < len(seqch):
- if not seqch[s].isalpha():
- new_string += seqch[s]
- s += 1
- return new_string
- def removeDigit_while(seqch):
- # @param seqch: String
- # return string
- s = 0
- new_string = ""
- while s < len(seqch):
- if not seqch[s].isdigit():
- new_string += seqch[s]
- s += 1
- return new_string
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement