About 349,000 results
Open links in new tab
  1. What is the proper way to comment functions in Python?

    Dec 14, 2019 · This is the built-in suggested convention in PyCharm for describing function using docstring comments: def test_function(p1, p2, p3): """ test_function does blah blah blah.

  2. Python Functions - W3Schools

    In Python a function is defined using the def keyword: To call a function, use the function name followed by parenthesis: Information can be passed into functions as arguments. Arguments …

  3. How to Define and Call a Function in Python - GeeksforGeeks

    Dec 16, 2024 · Let's understand defining and calling a function in detail: Defining a Function. By using the word def keyword followed by the function's name and parentheses we can define a …

  4. How To Define a Function in Python - LearnPython.com

    Apr 15, 2021 · We start with the def keyword to inform Python that a new function is being defined. Then, we give our function a meaningful name . Next, in parentheses, we list the …

  5. How to Define a Function in Python? - Python Guides

    Feb 10, 2025 · To define a function in Python, you use the def keyword followed by the function name and parentheses. Inside the parentheses, you can specify parameters that the function …

  6. Defining Your Own Python Function

    In this tutorial, you’ll learn how to define your own Python function. You’ll learn when to divide your program into separate user-defined functions and what tools you’ll need to do this. Here’s what …

  7. Python Define Function: Step-by-Step Instructions

    Basic Syntax: How to Define a Function in Python The basic syntax for defining a function is: def function_name(parameters): """Optional docstring""" # Function body return result

  8. How to Define a Function in Python

    Oct 18, 2023 · To define a function in Python, you use the def keyword followed by the name of the function, a list of parameters in parentheses, and a colon :. Here’s an example of a simple …

  9. Python Functions - W3docs

    To define a function in Python, you use the def keyword followed by the function name and parentheses. Inside the parentheses, you can specify any arguments that the function takes. …

  10. Professionals Explain How to Write and Call Functions in Python

    May 1, 2025 · Basic Syntax for Defining a Function in Python. In Python, defining a function starts with the def keyword, followed by the function name and a set of parentheses that may include …

  11. Some results have been removed
Refresh