Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
Find common characters between two strings
def printCh(str1,str2): string1 = str1 string2 = str2 s1 = set(string1) s2 = set(string2) common_char = s1 & s2 return common_char def printCh1(str1,str2): ans = [] for ch in str1: if ch in str2 and ch not in ans: ans += ch return ans string1 = 'sathuaa' string2 = 'hat' print(printCh(string1,string2)) print(printCh1(string1,string2))
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Rektangel
String Toggling
solving a linear system of equations
fibonaccii.py
Singleton Design in Python
selenium -proj
Урок 4 задача 4: решить в целых числах уравнение ax=b (python)
w3resource
isStrong.py
Circular progress bar tkinter
stackse - search stackoverflow differently
Please log in to post a comment.