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,520 points
1,544 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,910 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,520 points
1,700 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 15, 2020 in Python by Abhishek Shingadiya
3,290 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 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,140 views
0 votes
1 answer
+5 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,790 points
3,589 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 7, 2020 in Python by Gitika
• 65,910 points
980 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP