Split()'ing dilemma :))
Which one would you do? (In Python, of course ...:))
(1) 'jan,feb,mar,apr,may,jun'.split(',')
(2) str.split('jan,feb,mar,apr,may,jun', ',')
Both work.
However, in terms of syntax bulkiness, readability, future extensible, etc.
Say you have a dictionary of "fixed strings"; such as month or US state initial names (AZ, CA, ...,TX, ...)
Would you go with option (2) or (1)??
0 Comments:
Post a Comment
<< Home