Question: Write a program that compares two strings. Determine if the strings are exactly the same, the same to a certain index, or completely different
Write a program that compares two strings. Determine if the strings are exactly the same, the same to a certain index, or completely different and display the result to the console. To verify the code handles all three scenarios, use the following three sets of strings; 1. The weather was good on Monday" and "The weather was good on Monday" 2."The weather was good on Monday" and "The weather was good on Sunday" 3. "The weather was good on Monday" and "Storms are forecasted for tonight" Hint: use jumps to your messages and set up for multiple strings (commenting out the ones not being tested)
Step by Step Solution
3.32 Rating (164 Votes )
There are 3 Steps involved in it
Heres a Python program that compares two strings and prints the results to the console def comparest... View full answer
Get step-by-step solutions from verified subject matter experts
