Created
March 1, 2014 07:57
-
-
Save bitwiser/9286745 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mx = {'name':'Name','count':0} | |
def process_input(s): | |
row = s.split(); | |
if len(row)==4: | |
nm = row[1] | |
cnt = int(row[3]) | |
if cnt>mx['count']: | |
mx['name'] = nm | |
mx['count'] = cnt | |
if __name__ == '__main__': | |
while True: | |
s = raw_input('Enter space separated rows of list(q to display result): ') | |
if s == 'q': | |
print('{0} has maximum count of {1}.'.format(mx['name'],mx['count'])) | |
exit() | |
process_input(s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment