Easy to write because python does not need to close the door
>>> text = "Which is Kinoko SaMpLE ?"
>>> text.lower().replace("sample", "takenoko")
'which-kinoko-takenoko-?'
>>> text = "Which is Kinoko SaMpLE ?"
>>> (lambda x: x.lower().replace("sample", "takenoko"))(text)
'which-kinoko-takenoko-?'
I don't know if there is a scene that I actually want to use as it is
The ternary operator if ~ else can now be used on python, but in that case processing cannot be inserted
[x if x < 100 else 'kinoko' for x in A]
Can bring value
Recommended Posts