Computer Science, asked by priyanshusingh040, 11 months ago

9. Write a program that prompts the user for two strings and checks if one of the stringen
prefix of the other. Print an appropriate message to inform the user which is the prefinne
which or that neither is a prefix. For example, if the user input "evergreen" and "ever". the
program would respond: "ever" is a prefix of "evergreen". But if the input was "evergreen
and "green", the program would respond that neither is a prefix of the other.​

Answers

Answered by niteshmourya55p2picl
3

Explanation:

l=input("enter string")

p=input("enterprefix")

if p==l[0,len(p-1)]:

print ("yes")

else:

print ("prefix is not")

plz marks as brainlist

Similar questions