Is the python case sensitive ?

in this article you learn about case sensitivity in python within pythonwithyp, python is case sensitive programming language , suppose we define a variable “Hello World” , then an error will occur if the variable called “hello world” , these define ,and these both variable "Hello world " and "hello word" both have different meaning


Is the python case sensitive ? |pythonwithyp
Is the python case sensitive ? |pythonwithyp

Is the python case sensitive?

        Yes ! Python is case sensitive 


        

        What is meant by case-sensitive?


        Python is case sensitive  Language, like many other programming languages for

        example C++, Java, JavaScript 


        it means Uppercase and lowercase letters are treated  as distinct (case-sensitive) or equivalent

        (case-insensitive)


        For example , the " dog " and " Dog " in First word 'd' is lowercase and second in word 'D' is

       in Upper case but the meaning is same its mean case sensitive

        

        
        As we know the python case sensitive means “Hello World” and “hello world” are not the same.



        Example

        

        Name = "john"

        Second_Name = "Doe"


        print("my name is" + name + " "+ second_name)


V

It will show the ‘NameError’

Output

   Traceback (most recent call last):

    File "./prog.py", line 4, in <module>

    NameError: name 'name' is not defined


        Now we will solve this "NameError" this is a case sensitive error


        Example


        Name = "john"

        Second_Name = "Doe"


        print("my name is " + Name + " "+ Second_Name)



        Output


    my name is john Doe


Post a Comment (0)
Previous Post Next Post