Question

PYTHON QUESTION PLEASE!!Write a function named problem3 that accepts two strings as the arguments, returns the characters that occur in both strings.

Write a function named problem3 that accepts two strings as the arguments, returns the characters that occur in both strings. Test case: the arguments are “apple@123” and “banana@#345”, your program should return “a@3”.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code

def problem3(stri,str2): #string to character list Istl=[chr for chr in stri] Ist2=[chr for chr in str2] #removing duplicates

Output

nurtazadmurtaza:-/Desktops python3 chg.py a@3 murtaza@murtaza:-/Desktop$ I

Add a comment
Know the answer?
Add Answer to:
PYTHON QUESTION PLEASE!! Write a function named problem3 that accepts two strings as the arguments, returns...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT