हिंदी

Write a program to input any two strings and to check whether given strings are equal are not.

Advertisements
Advertisements

प्रश्न

Write a program to input any two strings and to check whether given strings are equal are not.

कोड लेखन
Advertisements

उत्तर

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
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 1: Review of Phython - EXERCISE [पृष्ठ २७]

APPEARS IN

सीबीएसई Computer Science with Python [English] Class 12
अध्याय 1 Review of Phython
EXERCISE | Q 25. | पृष्ठ २७
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×