Mega Code Archive

 
Categories / Python Tutorial / String
 

Case Sensitive Compare

cmpStr = "abc" upperStr = "ABC" lowerStr = "abc" print "Case Sensitive Compare" if cmpStr == lowerStr:     print lowerStr + " Matches " + cmpStr if cmpStr == upperStr:     print upperStr + " Matches " + cmpStr