Answer to Question #290250 in Python for Bubby

Question #290250

The Richest person


Input:

4

Jonncena 10000

Jane 2000

Jack 4000

Tom 4000

Output:

Jack 2


1
Expert's answer
2022-01-24T09:49:58-0500
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)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS