4 ms·
Dumb question, if you really need the exact string “info” in a given context, why not hard code it? What does .lower() or even a map liked the linked one actual
by mapgrep 6y ago
Dumb question, if you really need the exact string “info” in a given context, why not hard code it? What does .lower() or even a map liked the linked one actually buy you?
- nicoburns 6y agoPresumably it's for normalising input. Following the principle that you ought to be permissive in what data you accept, and strict in what data you give out.
- simion314 6y agoMaybe the input is case insensitive, for example if you work with html you might see "DIV","div" who knows some crazy dev or tool might generate "DIv" or "dIv" so is simpler to lowercase the input then work on it.