[3. Identifier]] Zero-based learning python, simple and rude

identifier

    • Identifiers are characters used to name constants , variables , methods , classes, and modules ;
    • Identifiers can be uppercase and lowercase letters , numbers , and underscores ;
    • The name cannot start with a number;
    • case sensitive;
    • The naming style can be: 
      √ CamelCase 
      √ Lowercase + Underscore 
      # Lowercase letter + underscore style variable definition
      the_radius_1 = 10
      
      # CamelCase variable definitions
      theRadius2 = 10
      
      # Lowercase letter + underscore style method definition
      def get_circle_area_1(r):
          return 3.14 * r * r
      
      # CamelCase method definition
      def getCircleArea2(r):
          return 3.14 * r * r

       

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325618711&siteId=291194637