Last active
July 23, 2020 20:57
-
-
Save raeq/93e71c95d1d53c9e92dae3fb1690f6ea to your computer and use it in GitHub Desktop.
List from csv line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def from_csv_line(line: str = "") -> list: | |
return line.split(",") | |
assert from_csv_line("a,b,c") == ["a", "b", "c"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated thanks to a comment by Hugo here:
https://medium.com/python-in-plain-english/22-pythonic-tricks-for-working-with-strings-8b893776743c