![]() ![]() The variable name should be descriptive to make code more readable. But it is not recommended because when we try to read code, it may create confusion. In the above example, we have declared a few valid variable names such as name, _name_, etc. Python is the highly object-oriented programming language that's why every data item belongs to a specific type of class. The process of treating variables is somewhat different from many other programming languages. It is necessary to understand how the Python interpreter works when we declare a variable. The equal (=) operator is used to assign value to a variable. When we assign any value to the variable, that variable is declared automatically. We don't need to declare explicitly variable in Python. It allows us to create a variable at the required time. Python does not bind us to declare a variable before using it in the application. Examples of invalid identifiers: 1a, n%4, n 9, etc.Examples of valid identifiers: a123, _n, n_9, etc.Identifier names are case sensitive for example, my name, and MyName is not the same.Identifier name must not be similar to any keyword defined in the language.Identifier name must not contain any white-space, or special character (!, #, %, ^, &, *). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |