Just for oneliner fun:
>>> names = 'Cohn, Mildred; Dolciani, Mary P.; Rees, Mina; Teitelbaum, Ruth; Yalow, Rosalyn' >>> print(*[f'{item[1][0]}. {item[0]}' for item in [name.split(', ') for name in names.split('; ')]], sep='\n') M. Cohn M. Dolciani M. Rees R. Teitelbaum R. YalowEDIT: to get expected output ('You entered:' followed by empty line):
>>> print('You entered:\n', *[f'{item[1][0]}. {item[0]}' for item in [name.split(', ') for name in names.split('; ')]], sep='\n') You entered: M. Cohn M. Dolciani M. Rees R. Teitelbaum R. Yalow
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.