About 2,280 results
Open links in new tab
  1. Python Functions - W3Schools

    Python Functions A function is a block of code which only runs when it is called. A function can return data as a result. A function helps avoiding code repetition.

  2. Python Functions - GeeksforGeeks

    Oct 4, 2025 · We can define a function in Python, using the def keyword. A function might take input in the form of parameters. The syntax to declare a function is: Here, we define a function …

  3. Python Cheat Sheet

    Compact Python cheat sheet covering setup, syntax, data types, variables, strings, control flow, functions, classes, errors, and I/O.

  4. Python Functions [Complete Guide] – PYnative

    Jan 26, 2025 · Python function is a block of code defined with a name. Learn to create and use the function in detail. Use function argument effectively.

  5. Python Function: The Basics Of Code Reuse

    Oct 19, 2025 · Learn how to create and use a Python function with Python's def keyword, why functions are useful, and learn about variable scope.

  6. Learn Functions in Python: Definition, Types, and Examples

    Jun 9, 2025 · We'll cover how to define and call functions, use arguments and return values, and explore different types of functions like lambda functions, recursive functions, and built-in …

  7. Python - Functions - Online Tutorials Library

    Defining a function only gives it a name, specifies the parameters that are to be included in the function and structures the blocks of code. Once the basic structure of a function is finalized, …

  8. Function Basics - Introduction to Python

    Jun 27, 2024 · We start with the def keyword, then the name of the function. After that, we have parentheses () where the parameters would go, and then a colon : to show the start of the …

  9. Python Functions

    In Python, a function is a block of code that performs a specific task and can be called using a function name. Functions are defined using the def keyword, followed by the function name …

  10. Parts of a Function in Python - Part 1 - CodingNomads

    In this and the following lesson, you'll look into each of these parts in more detail while you build out your first custom function from scratch. You can use the function you'll build to greet …