In this program, we will take two strings as input and create a string from two strings combining uncommon characters of the said strings.
Steps to solve the program
- Take two strings as input.
- Create an empty string.
- Using for loop add characters from string 1 to the empty string which is not in string 2.
- Repeat this process for string 2.
- Print the output.
#Input string
str1 = "abcdefg"
str2 = "xyzabcd"
str3 = ""
for char in str1:
if char not in str2:
str3 += char
for char in str2:
if char not in str1:
str3 += char
#Printing output
print(str3)
Output :
efgxyz