Upper Selected Letters

You are required to deliver the following function in the module upper_module (file upper_module.py):

upper_sel(text, ref)

such that

given
  • text, str

  • ref, str of lowercase letters

returns a str like text where
  • all letters occuring in ref are in upper case.

  • all characters that are not alphanumeric are replaced by a space (' ').

For example:


>>> upper_sel('La Vinagreta', 'aeiou')
'LA VInAgrEtA'

>>> upper_sel('La-Vinagreta-123.', 'xyz')
'La Vinagreta 123 '

Note

Observe that digits remain untouched.

Doctests are available in the upper_sel.test file.