Reputation:
I'd like to get a string and print it by separating the lowercase character classification.
s = list()
s = input('input : ')
and i wanna recognize, and remove lowercase.
Upvotes: 1
Views: 89
Reputation: 5434
Use the inbuilt string functions which inludes .isupper
and .islower
then join them accordingly if you want to.
inp = input()
up = ''.join(i for i in inp if i.isupper())
low = ''.join(i for i in inp if i.islower())
print('upper: {} \nlower:{} '.format(up,low))
BSDSsdsdSD
upper: BSDSSD
lower:sdsd
Upvotes: 2
Reputation: 10470
Use a regex like so:
import re
l = input('input :')
print(re.sub('[a-z]','',l))
Upvotes: 1