찾다

 >  Q&A  >  본문

python中name 'self' is not defined?

代码如下:报错为name 'self' is not defined,请问是什么原因?

1

2

3

4

<code class="python">class ListNode(object):

    def __init__(self, x):

        self.val = x

        self.next = None</code>

阿神阿神2897일 전1096

모든 응답(1)나는 대답할 것이다

  • ringa_lee

    ringa_lee2017-04-18 09:54:00

    전체 코드가 게시되지 않는데 문제가 있는 걸까요?

    회신하다
    0
  • 취소회신하다