Write program code for below input to get required output

0 votes

Write program/code for below input to get the required output

Input

str1= abcde

str2= abret

Output: "rcdt"

Please help me to solve this

Oct 6, 2020 in Python by Roshni
• 10,420 points
217 views

1 answer to this question.

0 votes

That is a "set subtraction" operation. Use the set data structure for that.

Str1 = {a,b,c,d,e}
Str2 = {a,b,r,e,t}
print Str1 - Str2

Output:

>>> print Str1 - Str2
set([r,c,d,t])
answered Oct 6, 2020 by Gitika
• 65,870 points

Related Questions In Python

0 votes
1 answer

Could you please help to write a code for this program

Hello, @Hitesh, You can follow the below: print("List of ...READ MORE

answered Nov 4, 2020 in Python by Roshni
• 10,420 points
365 views
+1 vote
1 answer
0 votes
1 answer

i write this python to read dataset into panda data frame but im getting NameError: name 'true' is not defined. Below is the code:

change  def parse(path):   g = gz ...READ MORE

answered Mar 14, 2020 in Python by Abhishek Shingadiya
1,017 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,870 views
0 votes
0 answers
+4 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,810 points
1,439 views
0 votes
1 answer

How to write a code In Python where input will be 1 then the output will be 2?

You can go through this:  def num(number): ...READ MORE

answered Oct 6, 2020 in Python by Gitika
• 65,870 points
77 views