The Richest person
Input:
4
Jonncena 10000
Jane 2000
Jack 4000
Tom 4000
Output:
Jack 2
N = int(input())
i = 1
names = []
while i<=N:
name = input()
names.append(name)
i += 1
fin_num = 0
fin_name = ''
for name in names:
for i in name.split():
if i.isdigit():
if int(fin_num) < int(i):
fin_num = i
fin_name = name
print(fin_name)
Comments
Leave a comment