Write a python function that takes two strings as a parameter and prints the shorter one


Topic: Write a python function that takes two strings as a parameter and prints the shorter one

Solution

def print_shorter(str1, str2):
   if (len(str1) > len(str2)):
      print(str2)
   else:
      print(str1)



List all Python Programs