About 2,430,000 results
Open links in new tab
  1. Return 的高级用法,你真的掌握了吗?(Python 篇) - 知乎

    Jul 17, 2025 · Python 允许函数返回多个值,实质是返回一个元组(tuple)。 调用方可直接通过 拆包 获得各值,这在数据处理与建模中非常常见。

  2. python中return的用法_returnpython中用法-CSDN博客

    Jul 2, 2019 · 本文详细解析了Python中return语句的多种使用场景,包括返回单一值、多个值、函数体内的多个return语句、默认返回None、递归函数中的return、交互模式下的return行为 …

  3. The Python return Statement: Usage and Best Practices

    See how Python return values work, including multiple results, so you write clear, testable functions. Follow examples and practice as you go.

  4. Python return statement - GeeksforGeeks

    Dec 10, 2024 · A return statement is used to end the execution of the function call and it "returns" the value of the expression following the return keyword to the caller. The statements after the …

  5. Python3入门系列之-----return返回值,我终于懂了 - 骑着乌龟赶 …

    Jul 18, 2020 · Python3入门系列之-----return返回值,我终于懂了 前言 初学者学习return的用法有点蒙,不知道它的作用是什么? 返回的是什么? 在什么时候要用? 小伙伴也可能会遇到和我 …

  6. Python 中 `return` 语句的全面解析 — geek-blogs.com

    Sep 21, 2025 · 本文详细介绍了 Python 中 return 语句的基础概念、使用方法、常见实践以及最佳实践。 return 语句是函数与调用者之间进行数据交互的重要机制,它可以返回单个值或多个 …

  7. Python return Keyword - W3Schools

    Definition and Usage The return keyword is to exit a function and return a value.

  8. Python return的用法 - 极客教程

    在Python中, return 语句用于从函数中返回值。 当调用一个函数时,它会执行函数内部的代码并返回一个值,这个值可以被调用函数的地方使用。

  9. 揭秘Python中的return关键字:如何高效实现函数返回值?

    Dec 25, 2024 · 在Python编程中, return 关键字是函数中用来结束函数执行并返回值的语句。 正确地使用 return 可以使函数更加高效和易于理解。

  10. Python return用法:为你的函数添加返回值 - 知乎

    Apr 11, 2024 · 在Python中,函数是一段具有特定功能的代码块,它可以接收输入(称为参数),并产生输出。 return 语句就是用来指定函数的输出的。