Tags
python
Asked 3 years ago
13 Aug 2021
Views 321
Janice

Janice posted

How do you compare two strings in Python ?

How do you compare two strings in Python ?
debugger

debugger
answered Aug 14 '21 00:00


we can compare two string by == ,
if both same it will returns True , otherwise False

s='string'
s1='string'
if s==s1 :
	print("Both string is same")
else:
	print("Provided string is not same")
  


Check the above example for comparing two strings in Python
we used if else condition
Post Answer