I have thw following list:
list1 = ["cmd_%Y","cmd_%y","cmd_other"]
I need to replace "%y" and "%Y" (uppercase and lowercase) using list comprehensions, I tried just for one substr:
list1 = [ cmd.replace('%Y', "some_val_forY") for cmd in list1 ]
And obviously I'm discarding non-pythonic way to solve this issue.
How can I modify my solution to acept both criteria and get:
list1 = [ "cmd_some_val_for_Y","cmd_some_val_for_y", "cmd_other" ]
Yin uppercase?