There are few methods are written which perform some of the tasks and return the string value.
def method1():
#stuffs
return string
def method2():
#stuffs
return string
def method3():
#stuffs
return string
outm1 = method1()
outm2 = method2()
outm3 = method3()
Now I want to perform the condition work to check whether 2 out of 3 above variable string value is same, if so I need to print that value otherwise will print different value.
I am aware that if the methods are returning True
or False
then we can do with below way,
if sum([outm1 , outm2 , outm3]) >= 2:
#do stuffs
but not sure how to perform with string values...