Question: Python. Please explain what the code does. 2. Write a script that takes in two strings from the user. If one string is the prefix
Python. Please explain what the code does.
2. Write a script that takes in two strings from the user. If one string is the prefix of the other string, print "True", otherwise, print "False". For example, if the user enters "paint" and "paintbrush", then the script would print "True". I the user entered "painting" and "painted", the script would print "False" because no string begins the other. Keep in mind that the the pair "paint" and "paintbrush" as well as the pair "paintbrush" and "paint" would print "True" because order does not matter
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
