79157968

Date: 2024-11-05 07:09:10
Score: 1
Natty:
Report link

I think it would be more elegant to use list comprehension here, for example:

my_list=["apple","banana","orange"]
my_list=[l.upper() if l == "banana" else l for l in my_list]
Reasons:
  • Low length (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Jan ZapaƂ