param2 (type): Description of param2. Returns: return_type: Description of return value. Raises: ExceptionType: Description of when this exception is raised. Examples: Example usage of the function. """ # Function implementation 在函数注释中,可以使用参数名后面的冒号(:)来指定参数的类型,以及...
In the example provided for calling a function, we used a comment to describe what the function was going to do. We will do the same in this example as well. Only that, we will use a docstring here to describe what the function will do. # defining a function def printOutput( str):...
# This is a comment # 2 + 2 2+3 #TODOFinish analyze space rock function defanalyzeSpaceRock(): # This code is a function that will take in # text and then see what type of space rock it is. # If the rock matches a certain type of rock ...
An optional description of the column. comment must be a STRING literal. RETURN { expression | query } The body of the function. For a scalar function, it can either be a query or an expression. For a table function, it can only be a query. The expression cannot contain: Aggregate fu...
# -*- coding: utf-8 -*-"""package.moduleA brief description goes here.copyright: (c) YEAR by AUTHOR.""" 注释(Comment) 如果使用注释来编写类属性的文档, 请在#符号后添加一个冒号":"。 (请用中文优雅注释) classUser(object):pass#: the name of the user as unicode stringname=Column(String...
import socket from geoip import geolite2 import argparse if __name__ == '__main__': # Setup commandline arguments parser = argparse.ArgumentParser(description='Get IP Geolocation info') parser.add_argument('--hostname', action="store", dest="hostname", required=True) # Parse arguments ...
Let’s write a function that takes an input argument and actually does something with it. We’ll adapt the earlier code fragment that comments on a color. Call it commentary and have it take an input string parameter called color. Make it return the string description to its caller, which...
# first level: inside function if temperature > 70: # second level: inside if if is_raining: # third level: nested condition print("it's warm but raining") print("take an umbrella") else: print("it's a warm, sunny day") print("perfect for outdoors") else: print("it's cool out...
(简单的概述模块) A longer description of the module.(模块的细节) """ import sys # 注意通过空行增加可读性 4.块注释和行注释 对块注释和行注释也进行了差异化: 块注释解释整块的,没那么一目了然的代码: """ This is a block comment that spans multiple lines """ 行注释用来解释单行,不要过多...
函式的批注。function_comment必須是 String 常值。 CONTAINS SQL或READS SQL DATA 函式會直接或間接地從數據表或檢視表讀取數據。 當函式讀取 SQL 資料時,您無法指定CONTAINS SQL。 如果您未指定任一子句,屬性會衍生自函式主體。 Python UDF 中支持的連結庫 ...