Hint: You can access a value in a dictionary by its key:
>>> workdays = {'work':'1,2,3,4'}
>>> workdays['work']
'1,2,3,4'
Second hint: You can split a string using str.split(delimiter)
like so:
>>> s="1,2,3,4"
>>> s.split(',')
['1', '2', '3', '4']
Third hint: len()
More Related Contents:
- Split a Pandas column of lists into multiple columns
- Split Strings into words with multiple word boundary delimiters
- Split string with multiple delimiters in Python [duplicate]
- How to split a string of space separated numbers into integers?
- How to split text without spaces into list of words
- How to split elements of a list?
- Pandas split DataFrame by column value
- Python split() without removing the delimiter [duplicate]
- How can I split and parse a string in Python?
- How do I split a multi-line string into multiple lines?
- Splitting a list based on a delimiter word
- How to split strings into text and number?
- Splitting on first occurrence
- How do I split a list into equally-sized chunks?
- Split list into smaller lists (split in half)
- Splitting on last delimiter in Python string?
- Python split string into multiple string [duplicate]
- When splitting an empty string in Python, why does split() return an empty list while split(‘\n’) returns [”]?
- Splitting a string by list of indices
- Split string based on regex
- Splitting large text file into smaller text files by line numbers using Python
- Split function add: \xef\xbb\xbf…\n to my list
- Convert string to list. Python [string.split() acting weird]
- removing newlines from messy strings in pandas dataframe cells?
- Make Python Sublists from a list using a Separator
- How can I split a string of a mathematical expressions in python?
- How do I split a string into a list of words?
- The result list contains single spaces when splitting a string with re.split(“( )+”) – is there a better way?
- Split string at nth occurrence of a given character
- Split text after the second occurrence of character