python get all characters
import string
# all the lowercase and uppercase letters
print(string.ascii_letters)
# every printable key on your keyboard
print(string.printable)
# every digit
print(string.digits)
python get all characters
import string
# all the lowercase and uppercase letters
print(string.ascii_letters)
# every printable key on your keyboard
print(string.printable)
# every digit
print(string.digits)
python3 return a list of indexes of a specific character in a string
string='mississippi'
s='s'
lst= []
for i in range(len(string)):
if (string[i] == s):
lst.append(i)
print(lst)
#result: [2, 3, 5, 6]
count characters in string python
>>> sentence = 'Mary had a little lamb'
>>> sentence.count('a')
4
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us