程序输出错误信息“<function score at 0x036374F8>”,并且在调用函数和打印i时没有输出正确的信息

2024-10-01 19:22:28 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图让我的程序在通过一个预定义的函数后打印出分数('9'),但它没有打印出正确的东西

x=8
  def score():
  globz=x
  print(globx)
  globx+=1
  return globx

x=(score)
print(x)

外壳显示:

<'function score at 0x036374F8'>

这不是我想要的。为什么我看到的是这个而不是函数的输出


Tags: 函数程序returndeffunction外壳分数at

热门问题