0
I need help to complete a test
Good morning community, I need your help to be able to solve a Python test. They ask me to extract the longest word from a text with the "split()" method, I use it with the "max()" method but from all the text I only get two letters. I don't know how to fix it anymore.
4 Antworten
+ 1
You should read the documentation for max before using it. Or any function. What happens when using max to compare strings?
0
Share your code and we can explain what's going on.
0
txt = input()
#tu código va aquí:
text = txt.split(' ')
text1 = max(text)
print(text1)