3, then pear, fig and plum, one on each line, and the program keeps the longest word.
n = int(input())
longest = ""
for i in range(n):
word = input()
if len(word) >= len(longest):
longest = word
print(longest, n)
What is printed?Log in to join the discussion.
Loading…