I have a list of Key, Value pairs
lst = [
('AAI', 'AirportAuthorityofIndia'),
('AAO', 'AssistantAccountsOfficer'),
('AB', 'AutonomousBodies'),
('ABA', 'AntiBoostMissile'),
('ABC', 'AuditBureauofCirculation'),
('ABM', 'AntiBallisticMissile'),
('ABVP', 'AkhilBharatiyaVidyarthiParishad'),
('AC', 'AssistantCollector'),
('AC', 'AirConditioner'),
('ACL', 'AccessControlList'),
('ACT', 'AssociationofComputerTechnology')]
What I am trying to do is add spaces between the words in the values. For example:
I need to split:
('AAI', 'AirportAuthorityofIndia')
into ('AAI', 'Airport Authority of India')
('ACT', 'AssociationofComputerTechnology')
into ('ACT', 'Association of Computer Technology')
If it's only capital letters I can do it using Regular Exression
[(abbr, re.sub(r'([a-z])(?=[A-Z])', r'\1 ', long)) for abbr, long in lst]
and I get
[('AAI', 'Airport Authorityof India')....etc
How do I add space between the lowercase letters as well?
Or is there any other method I can use to do this?