牛客网刷题
刚刚学习,在牛客网刷题遇到问题。用的Python
题目描述
输入一个链表,从尾到头打印链表每个节点的值。
# -*- coding:utf-8 -*-
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
# 返回从尾部到头部的列表值序列,例如[1,2,3]
def printListFromTailToHead(self, listNode):
# write code here
这上面的注释部分有什么作用,看了Python版的答案,不知道为什么那么写,可有Python大神,指导一下,谢谢