dimanche 19 avril 2020

String Comparison Logic Python [duplicate]

I'm just starting to learn python and I am having some issues in comparing strings. I tried to look around but even after trying "==" and "is" and "eq()", my program still does not work.

I am used to working in Java, am I missing some sort of logic? Here is my code:

name = "John Smith"
name2 = name.lower
lowerName = name.lower

if name2 is lowerName:
    print("it is the same name") #this is never outputted

Aucun commentaire:

Enregistrer un commentaire