About 1,220,000 results
Open links in new tab
  1. 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 are specified after the function name, inside the parentheses. You can add as many arguments as you want, just separate them with a comma.

  2. Built-in FunctionsPython 3.13.3 documentation

    2 days ago · The Python interpreter has a number of functions and types built into it that are always available. They are listed here in alphabetical order. Return the absolute value of a number. The argument may be an integer, a floating-point number, or an object implementing __abs__(). If the argument is a complex number, its magnitude is returned.

  3. Python Functions - GeeksforGeeks

    Mar 10, 2025 · Below are the different types of functions in Python: Built-in library function: These are Standard functions in Python that are available to use. User-defined function: We can create our own functions based on our requirements. We can define a …

  4. Python Functions (With Examples) - Programiz

    A function is a block of code that performs a specific task. In this tutorial, we will learn about the Python function and function expressions with the help of examples.

  5. Functions in Python – Explained with Code Examples

    Jul 28, 2021 · There's a whole wealth of built-in functions in Python. In this post, we shall see how we can define and use our own functions. Let's get started! Python Function Syntax. The following snippet shows the general syntax to define a function in Python: def function_name (parameters): # What the function does goes here return result

  6. Python Functions - Python Guides

    In Python, you define a function using the def keyword, followed by the function name and parameters in parentheses: def function_name(parameters): """Docstring: explains what the function does""" # Function body # Code to execute return result # Optional return statement

  7. 16 Python Functions Exercises and Examples - Pythonista Planet

    In this post, I have compiled a list of examples of functions in Python. Check out these examples and understand how functions work in various scenarios. I hope this will help you get a clear picture of Python functions. Let’s dive right in. 1. Python function that prints a text.

  8. An Essential Guide to Python Functions By Examples

    A Python function is a reusable named block of code that performs a task or returns a value. Use the def keyword to define a new function. A function consists of function definition and body.

  9. Complete Python Program - Mastering from Fundamentals

    Grasp Python fundamentals and architecture. Set up Python and popular code editors. Master Python basics: variables, data types, control flow, functions, and I/O. Manage Python data structures efficiently. Understand NumPy and pandas essentials; Understand statistical analysis essentials. Understand Tkinter essentials

  10. Functions in Python (With Examples) - Python Tutorial

    Functions are small parts of repeatable code. A function accepts parameters. Without functions we only have a long list of instructions. Functions can help you organize code. Functions can also be reused, often they are included in modules. Functions can be seen as executable code blocks. A function can be used once or more.

  11. Some results have been removed