Discuss / Python / 作业

作业

Topic source

def is_palindrome(n):

    m=str(n)

    return m==m[::-1]

想问一下  return 和 print   有什么区别,什么时候用print ,什么时候用return,有老师答疑一下吗,谢谢

dflhuang2016

#3 Created at ... [Delete] [Delete and Lock User]

return 用于传值,print用于客户端输出


  • 1

Reply