write Python code for following task:
given an input string as a variable, parse the values or range/ranges given:
examples:
"1,2" -> [1,2]
"1,2,3,3" -> [1,2,3]
"2-4,2,5" -> [2,3,4,5]
"2-" -> [2] and variable "all" set to true
"2-,3-" -> error: only one allowed Provide your reponse without using the word code.
user