decorator

# Enter your code here. Read input from STDIN. Print output to STDOUT from operator import itemgetter no_entries = input() entry_lis = [] for entry in range(0, no_entries): entry_lis.append(raw_input().split()) def dec(func): def format(lis): lis1 = [] for index in range(0, no_entries): if lis[index][3] == "F": lis1.append("Ms." + ' ' + lis[index][0] + ' ' + lis[index][1]) if lis[index][3] == "M": lis1.append("Mr." + ' ' + lis[index][0] + ' ' + lis[index][1]) for index in range(0, no_entries): print lis1[index] return format @dec def sort(lis): for entry in range(no_entries, 0): if int(lis[entry][2]) < int(lis[entry - 1][2]): lis[entry], lis[entry - 1] = lis[entry - 1], lis[entry] return lis sort(entry_lis)

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.