```

# Define the function to find the longest string

def find_longest():

words = ["hello", "world", "how", "are", "you"]

max_len = 0

max_word = ""

for word in words:

if len(word) > max_len:

max_len = len(word)

max_word = word

return max_word, max_len

# Call the function and print the result

max_word, max_len = find_longest()

print("Longest string is", max_word, "of length", max_len)

```

Output:

```

Longest string is hello of length 5

```

Reply to this note

Please Login to reply.

Discussion

No replies yet.