Q:

Write a Python program to sort each sublist of strings in a given list of lists

0

Write a Python program to sort each sublist of strings in a given list of lists.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

def sort_sublists(input_list):
    result = list(map(sorted, input_list)) 
    return result
color1 = [["green", "orange"], ["black", "white"], ["white", "black", "orange"]]
print("\nOriginal list:")
print(color1)  
print("\nAfter sorting each sublist of the said list of lists:")
print(sort_sublists(color1))

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now