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
Get step-by-step solutions from verified subject matter experts
