import re
string = "J:_)Yg;8SpL.Rt1rw~E^`0cHblnG}v|$a,3O#IXKQ\W2+N(eP"
numbers = re.findall(r'\d', string)
letters = re.findall(r'[a-zA-Z]', string)
symbols = re.findall(r'[^a-zA-Z\d\s]', string)
print("Numbers:", numbers)
print("Letters:", letters)
print("Symbols:", symbols)
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
import re
string = "J:_)Yg;8SpL.Rt1rw~E^`0cHblnG}v|$a,3O#IXKQ\W2+N(eP"
numbers = re.findall(r'\d', string)
letters = re.findall(r'[a-zA-Z]', string)
symbols = re.findall(r'[^a-zA-Z\d\s]', string)
print("Numbers:", numbers)
print("Letters:", letters)
print("Symbols:", symbols)