Make a function called symmetricDifference that takes two strings: word1 and word2 as parameters and returns a
Fantastic news! We've Found the answer you've been seeking!
Question:
Define a function symmetricDifference with two string parameters. You can expect strings with only alphabetic characters and no numeric or special characters.
Convert both the strings to lowercase
Return a list of letters that do not occur in both the words. Note that multiple occurrences will only be marked once in the output list.
Hint: You can make use of the set data structure to remove duplicate elements.
Define main function
Create two strings of your choice with only alphabetic characters. You can alternatively use the sample inputs provided below:
Call the symmetricDifference function with the created strings
Print the results
Call the main function using " __name__ == __main__" call as done in the previous assignments
Sample Input/Output:
>> print(symmetricDifference('apple', 'party'))
>> ['e', 'l', 'r', 't', 'y']
Related Book For
Management Accounting Information for Decision-Making and Strategy Execution
ISBN: 978-0137024971
6th Edition
Authors: Anthony A. Atkinson, Robert S. Kaplan, Ella Mae Matsumura, S. Mark Young
Posted Date: