Advertisements
Advertisements
Question
Write a program to input any two strings and to check whether given strings are equal are not.
Code Writing
Advertisements
Solution
Compare the two strings using the equality operator ==.
string1 = input("Enter first string: ")
string2 = input("Enter second string: ")
if string1 == string2:
print("Strings are equal")
else:
print("Strings are not equal")
shaalaa.com
Is there an error in this question or solution?
