define a function
定义一个函数
让我们定义一个函数 makeRange就像Python一样range。 Let's define a function makeRange that's just like Python's range. For example, define a function , including the above several parameters:. For example, define a function , including the above several parameters:. For example, define a function , including the above several parameters:. 首先,我们将导入一个Python包并定义一个函数 。 First, we will import a Python package and define a function . Combinations with other parts of speech
When you defined a function , you created an object. In our example, we defined a function . How is a function defined ? How to define a function ? The def statement is used to define a function . Now let us define a function by . We want to define a function . Below we will define a function . Instead, you are forced to define one function for each arity:. So far we have learned how to define a function . 也就是说,你不能定义一个函数 来计算任意数量的参数的和:. That is, you can't define a function that computes the sum of an arbitrary number of parameters:. 因为所有JavaScript对象都是闭包,因此,当你定义一个函数 的时候,你就定义了一个闭包。 Since all JavaScript functions are closures, it's obvious: when you define a function , you actually define a closure. 定义一个函数 load(f)以要读取的文件名为其唯一参数,返回包含文件中文本的字符串。Define a function load(f) that reads from the file named in its sole argument, and returns a string containing the text of the file. a. . 现在我们可以定义一个函数 去创造一个新的数据集,如上面所述的那样。 Now we can define a function to create a new dataset as described above. 先定义一个函数 ,传入一个list,添加一个END再返回. First define a function , pass in a list, add an END and then return:. 我们可以定义一个函数 notify来调用其参数item上的summarize方法,该参数为一些实现了Summarytrait的方法。 We can define a function notify that calls the summarize method on its parameter item, which is of some type that implements the Summary trait. 我们定义一个函数 f,从而简化了问题,并调用自身来解决一个或多个同样问题的更简单的实例。 We define a function f which simplifies the problem, and calls itself to solve one or more easier instances of the same problem. 我们自己定义一个函数 ,只要相信在验证函数的正确性时,更简单的情况能正常工作就可以了。 We define a function in terms of itself, but simply trust that the simpler cases will work correctly when verifying the correctness of the function. . 例如,接着可以定义一个函数 来获取任何IpAddrKind:. We can then, for instance, define a function that takes any IpAddrKind:. 现在,当我们定义一个函数 时,我们可以使用log来“装饰”它:. Now, when we define a function , we can“decorate” it using log:. 我们先定义一个函数 ,它可以检查一个数字是否为素数:. Let us first define a function that will check if a given number is a prime:. 我们定义一个函数 响应,它搜索用户的话语中的一个或多个已知关键字,并返回几个可能的响应之一。 We define a function response which searches the user's utterance for one or more known keywords and returns one of several possible responses. 让我们从定义一个函数 is_content_word()开始,它检查一个词是否来自一个开放的实词类。 Let's start by defining a function is_content_word() which checks whether a word is from the open class of content words. 从理论上讲,这是非常安全的,因为,记住,定义一个函数 实际上并不执行它。 In theory, this is perfectly safe, because, remember, defining a function doesn't actually execute it.
Display more examples
Results: 43 ,
Time: 0.0163