Write a method that returns the longest common prefix of two strings. For example, the longest common prefix of distance and disinfection is dis. The header of the method is: def prefix(s1, s2) If the...


Write a method that returns the longest common prefix of two strings. For example, the longest common prefix of distance and disinfection is dis. The header of the method is:
def prefix(s1, s2)
If the two strings have no common prefix, the method returns an empty string.
Write a main method that prompts the user to enter two strings and displays their common prefix.



Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here