user
Given a list of names, create a function to find the longest name.

James, Maria, Robert


assistant
def find_longest_name(names): 
  longest_name = ""
  for name in names:
    if len(name) > len(longest_name):
      longest_name = name
  return longest_name
  
print(find_longest_name(["James", "Maria", "Robert"]))

# Output: Robert