Advertisement
k1alo

Longest_word

Nov 9th, 2023
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. string = "ля ляля ляляля"
  2. words = string.split()
  3. longest_word = ""
  4. for word in words:
  5.     if len(word) > len(longest_word):
  6.         longest_word = word
  7.  
  8. print(f"Самое длинное слово: {longest_word}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement