def positive_int_list(argument):
 if (',' in argument):
  entries = argument.split(',')
 else:
  entries = argument.split()
 return [positive_int(entry) for entry in entries]

def positive_int_list ( argument ) : if ( ',' in argument ) : entries = argument . split ( ',' ) else : entries = argument . split ( ) return [ positive_int ( entry ) for entry in entries ]
converts a space- or comma-separated list of values into a python list of integers .