Python

Constant dripping wears away a stone

Reserved Words and Variables


  • Reserved Words:

    A reserved word in programming languages is a word that has a fixed meaning and is used for specific programming instructions. They can not be used for variable names, function names, or any other programming elements. The following is a list of reserved words in Python 3.

  • Variables:

    A variable is a location where computers use to store a value. The value may change when there are operations on the variable in the program. Variable declaration is a process which reserves a memory space in the computer's main memory for storing the content of a variable. Unlike other programming languages such as C, C++, Java, etc., Python does not need to declare a variable before using it.

    • Types of Variables: integer, decimal, boolean, string, etc.
    • Rules of Naming Variables: The names can contain English uppercase or lowercase characters and underscore. A variable name can also contain numbers. However, it cannot start with a number. Spaces are not allowed in variable names. For example, city_name, zip_code, and phone_number are valid variable names. However, zip-code and 3people are not valid Python variable names.