Create a function in Python that takes two strings as inputs and prints out the longer of the two strings.
Hello
World
def longestString(str1, str2):
  if len(str1) > len(str2):
    return str1
  else:
    return str2

print(longestString("Hello", "World"))