count total in a list python by split

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()

Browse More Popular Posts

Leave a Comment