What do you want to save?
Add Code snippet
New code examples
-
TypeScript 2022-01-22 03:31:25
how to separate a string into 2 lists of numbers and letters python
stringtosplit = 'hello75world' letters = [] numbers = [] for k in stringtosplit: if k.isalpha() == True: letters.append(k) elif k.isdigit() == True: numbers.append(k) letters = ''.join(letters) numbers = ''.join(numbers) print(numb... Add solution -
Python 2021-10-22 20:34:09
string validators hackerrank solution
if __name__ == '__main__': s = input() print(any(i.isalnum() for i in s)) print(any(i.isalpha() for i in s)) print(any(i.isdigit() for i in s)) print(any(i.islower() for i in s)) print(any(i.isupper() for i in s)) #The any() funct... Add solution -
Other 2021-10-19 18:19:07
extract letters from a string
Extract numbers from a string Character.isDigit(str.charAt(i)) Character.isLetter(str.charAt(i)) Character.isAlphabetic(str.charAt(i)) String password = "cnE4g1Z5y9A"; String[] letters= password.split("[0-9]"); ==> cnEgZyA St... Add solution -
Other 2021-10-15 08:41:04
word level text generation keras
import string # load doc into memory def load_doc(filename): # open the file as read only file = open(filename, 'r') # read all text text = file.read() # close the file file.close() return text # turn a doc into clean tokens def clean... Add solution -
Python 2021-10-10 03:47:05
isaplha in python
str = "abc" print(str.isalpha()) Add solution -
Other 2021-09-16 16:02:04
Check if Dataframe Column contains only Alphabets and No Spaces and No Special Characters
df['Last Name Completely Alphabets ?'] = df.apply(lambda x: 1 if x['Last Name'].isalpha() == True else 0, axis = 1) df['First Name Completely Alphabets ?'] = df.apply(lambda x: 1 if x['First Name'].isalpha() == True else 0, axis = 1) Add solution