def answers():
ppv = tp/(tp + fp)
rcl = tp/(tp + fn)
return ppv, rcl
print("enter the value of true positive")
tp = input()
print("enter the value of false negative")
fn = input()
print("enter the value of false positive")
fp = input()
print("enter the value of true negative")
tn = input()
print('ppv and recall answers')
print(answers)
这是一个基于python中公式的基本计算器,它不显示任何错误,但也不显示所需的输出。有关更多信息,请查看下图
here check the output it returns something like this <function answers at 0x000002377567F040>
您正在打印函数而不是调用它
而不是
将参数传递给函数,而不是全局设置和访问参数,也更为简洁
见下文(类似于此):
您的代码中有几个错误。您应该学习一些python的基本教程,这些教程应该展示如何调用函数和处理用户输入
您不调用函数,应该将输入转换为
int
s:也许更好的版本是将数字转换为
float
并将其作为参数传递:注意,我已经注释掉了请求
tn
的位,因为它没有在answers()
函数中使用相关问题 更多 >
编程相关推荐