This method is used to compare two strings.
xxxxxxxxxx
s1 = “Python”
s2 = “Python”
if(s1 == s2):
print(“Both strings are equal”)
xxxxxxxxxx
string1 = input("Enter the first string: ")
string2 = input("Enter the second string: ")
if string1 == string2:
print("The strings are equal.")
else:
print("The strings are not equal.")