0
longest word
help me please how it works?
6 Respostas
+ 1
Hi! "how it works" what? Your question is not clear... 😔
+ 1
txt = input()
f=(txt.split())
mnr = 0
max = len(f[mnr])
for i in range(len(f)):
if len(f[i]) > max:
max = len(f[i])
mnr = i
print(f[mnr])
0
Show your attempt first
0
txt = input().split()
index = -1
max = 0
for i, word in enumerate(txt):
if len(word) > max:
index = i
max = len(word)
print(txt[index])
- 1
This code is working fine
- 1
i mean HOW it works, because i am fined this code in google