F Two String equal or not using Python program | CodeTheta

Two String equal or not using Python program

June 26, 2018

Using predefined value.
Code :
StringOne = 'www.codetheta.com'
StringTwo = 'ww.codetheta.com'
if StringOne == StringTwo:
    print ("Two Strings are Equal")
else:
    print ("Two Strings are not Equal")

Output :
Two Strings are not Equal

Value given in program runtime
Code :
StringOne = input("Enter first string: ")
StringTwo = input("Enter second string: ")
if StringOne == StringTwo:
    print ("Two Strings are Equal")
else:
    print ("Two Strings are not Equal")

Output :
Enter first string: codetheta
Enter second string: codetheta
Two Strings are Equal

IDE Used To Test This Code : Python IDLE.

Try this code in your computer for better understanding. Enjoy the code. If you have any Question you can contact us or mail us.We will reply you as soon as possible.

Post a Comment