New course! Every coder should learn Generative AI!
Try a free lesson- 2
Make a function that takes two strings as input, and outputs the common characters
good day people, Please kindly assist. Note: my answer should not allow someone to input anything. My Attempt below i asked for an input, so please assist in providing me with another solution: user_str_1 = input("Input String 1: ") user_str_2 = input("Input String 2: ") s1 = set(user_str_1) s2 = set(user_str_2) lst = list(s1 & s2) print(" Common letters: {}" .format(lst))
1 Answer
+ 2
I think you wanted to give your values as string so you can remove input function and write what you want. I hope it helps you