Question: # 5 . Lists # Write a function that will take a string of comma - separated integers ( assume ' , ' between each

# 5.Lists
# Write a function that will take a string of comma-separated integers (assume ',' between each integer)
# and returns a list of those integers in descenging order
def sort_string(text):
numbers =[int(num) for num in text.split(',')] # your implementation here: don't forget to "return" something
numbers.sort(reverse=True)# For example, sort_string('1,2,3') should return [3,2,1]
return numbers

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!