Advertisement
gruntfutuk

temp2351

Oct 24th, 2019
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. def missing_letters(user_str):
  2.     """
  3.        This function takes string as argument and prints out the missing letters.
  4.    """
  5.     ht = histogram(user_str)  # Calling the histogram function as a requirement.
  6.     ml = sorted(list(set(alphabet).difference(set(user_str))))
  7.     if not ml:
  8.         return f"{user_str} contains all letters."
  9.     else:
  10.         return f'{"".join(ml)} {"is" if len(ml) == 1 else "are"} missing'
  11.  
  12.  
  13. for test in test_dups:
  14.     print(f"In {test}, {missing_letters(test)}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement