MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/igvny1/python_goes_brrrr/g2xod37
r/ProgrammerHumor • u/das_freak • Aug 26 '20
789 comments sorted by
View all comments
Show parent comments
1
[i for i in ‘abcdefghijklmnop.’]. So much better then typing [‘a’, ‘b’, ‘c’, ...]
[i for i in ‘abcdefghijklmnop.’]
[‘a’, ‘b’, ‘c’, ...]
2 u/mxzf Aug 26 '20 Alternatively, you can just do list('abcd') instead and cast the iterable string straight to a list (or, better yet most of the time), just iterate over the string in the first place without casting it to list.
2
Alternatively, you can just do list('abcd') instead and cast the iterable string straight to a list (or, better yet most of the time), just iterate over the string in the first place without casting it to list.
list('abcd')
1
u/JJ_The_Jet Aug 26 '20
[i for i in ‘abcdefghijklmnop.’]. So much better then typing[‘a’, ‘b’, ‘c’, ...]