Question: Create a Python program duplicates.py containing a function has_dup(s) returning True if the input string s contains two characters that are the same (and False

Create a Python program duplicates.py containing a function has_dup(s) returning True if the input string s contains two characters that are the same (and False otherwise). That is, the strings abcx, aYbx, and aAbB should all return False whereas ybbx, xxxyyyxxx, and xerox should all return True. Also, add program code that demonstrates how the function can be used.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!