About 5,960 results
Open links in new tab
  1. Python def Keyword - GeeksforGeeks

    Jun 8, 2026 · Explanation: def func (): Defines a function named func. print ("Hello"): Code inside the function that runs when called. func (): Calls the function, printing Hello to the output. The below …

  2. Python def Keyword - W3Schools

    Definition and Usage The def keyword is used to create, (or define) a function.

  3. What is Def in Python? Defining Functions Explained

    Learn what def means in Python, how to define functions, call them, and use def with classes. Examples for beginners included.

  4. How To Define A Function In Python?

    Feb 10, 2025 · Read How to Get the Name of a Function in Python? Define a Function in Python To define a function in Python, you use the def keyword followed by the function name and parentheses. …

  5. 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.

  6. What does -> mean in Python function definitions? - Stack Overflow

    Feb 17, 2025 · In more recent versions of Python >= 3.5, though, it has a defined meaning. PEP 3107 -- Function Annotations described the specification, defining the grammar changes, the existence of …

  7. Python Functions - GeeksforGeeks

    May 22, 2026 · Python functions are reusable blocks of code used to perform a specific task. They help organize programs into smaller sections and execute the same logic whenever needed by calling the …

  8. What Does ‘defMean in Python?: Definition with Examples

    Apr 17, 2025 · Every great Python program starts with a single word: def. It is the keyword that unlocks one of the most powerful concepts in programming, reusable, organized,..

  9. Understanding `def` in Python: Functions Unveiled - CodeRivers

    Feb 7, 2025 · Python is a versatile and powerful programming language known for its simplicity and readability. One of the key constructs that contributes to its elegance is the `def` keyword, which is …

  10. def | Python Keywords – Real Python

    In Python, the def keyword defines a function, which is a reusable block of code that can accept data input, perform a specific computation or task, and return a result or produce a side effect. Functions …