मराठी

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×