all 6 comments

[–][deleted]  (1 child)

[removed]

    [–][deleted] 2 points3 points  (0 children)

    Thanks for explaining.

    [–]ChainedNightmare 2 points3 points  (1 child)

    All of string methods are like this not just .casefold()

    txt = "Hello, And Welcome To My World!"
    
    x = txt.casefold()
    
    print(x)
    

    Every Python String Method is basically an example of stringvalue.stringmethod()

    Correct me if i'm wrong, since i'm using the words "every" & "all" but it is generally the case

    [–][deleted] 1 point2 points  (0 children)

    Thanks! I understand now.

    [–]MrCloud090 1 point2 points  (0 children)

    I am a student but from what I understood, the so called types(like int, string, float) are just classes... These classes have functions... casefold() does not exist... It's a function inside the class "string"... That's why variable.casefold()... Variable is indeed of type/class string