How to print all letters present in two strings with Python

1 Answer

0 votes
s1 = "python"
s2 = "java"

lst = list(set(s1) | set(s2))

for ch in lst:
    print(ch)
    
    
    
'''
run:

p
j
h
a
o
y
t
n
v

'''

 



answered Sep 12, 2023 by avibootz
...