Skip to content

Instantly share code, notes, and snippets.

@bitwiser
Created March 1, 2014 07:57
Show Gist options
  • Save bitwiser/9286745 to your computer and use it in GitHub Desktop.
Save bitwiser/9286745 to your computer and use it in GitHub Desktop.
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