简体   繁体   English

python:为什么当我调用 function 时它显示未定义的变量?

[英]python: why it says undefined variable when I call function?

在此处输入图像描述

I don't know why the function name has been considered as a variable, how should I solve this?我不知道为什么 function 名称被认为是一个变量,我应该如何解决这个问题?

You need to call self.getlen(dataSet) , since you defined the function as a member of the class.您需要调用self.getlen(dataSet) ,因为您将 function 定义为 class 的成员。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当我尝试调用一个函数时,它说有一个错误 - When I try to call a function, it says there is an error 为什么不能在Python中使用变量作为参数来调用此函数? - Why can I not call this function using a variable as an argument in Python? 为什么我不能从python中的另一个函数调用一个函数。 函数未定义错误 - why can't I call a function from another function in python. function undefined error 为什么在python中将函数赋值给变量直接调用函数在执行上有区别 - Why is the difference in execution when we assign a function to variable and directly call function in python Python:调用包含变量的函数时,变量未定义 - Python: variable is undefined when calling function containing the variable 我需要使用变量调用 python function - I need to call a python function using a variable python 中的名称错误,同时在另一个 function 变量中调用其他函数,已在 function 中定义,该变量已被调用但显示未定义 - Name error in python while calling out other functions in another function variable, already defined in function which is called but says undefined Python为什么将我的函数调用读取为变量调用? - Why is Python reading my function call as a variable call? 在 vscode 的终端中运行我的编码器时,它说我的变量未定义 - when running my coder in terminal of vscode it says my variable is undefined 使用海龟模块创建 function 时,Python 说我的海龟名称变量未定义 - When creating a function using the turtle module, Python says my turtle name variable is not defined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM