Write a program in Python to print the lexicographically sorted collection

Rajnilari2015
Posted by Rajnilari2015 under Python category on | Points: 40 | Views : 165
Given an collection as "dky", "amit", "sumit", "deepak". The objective is to print the lexicographically sorted collection. The below program will do so

from System import *
from System.Collections.Generic import *
from System.Linq import *

class Program(object):
def Main(args):
List[str]("dky", "amit", "sumit", "deepak").OrderBy().ToList().ForEach()
Console.ReadKey()

Main = staticmethod(Main)

Comments or Responses

Login to post response