Jump to content

Parameter (computer programming)

From Simple English Wikipedia, the free encyclopedia
Revision as of 10:04, 8 January 2025 by 89.197.81.210 (talk) (Fixes)

A Parameter is a Value that is passed into a function.

Parameter (programming)

In programming, a parameter is a variable used in a function or method that allows data to be passed into it. It acts as a placeholder for information the function needs to perform its task. Parameters are defined when creating the function and are replaced with specific values when the function is called.

For example, in the following Python function:


def greet(name):

print("Hello, " + name + "!")


The word name is a parameter. When the function is called with a value (like "Alice"), the parameter name will hold that value and the function will use it to perform its action:


greet("Alice") # Outputs: Hello, Alice!


In this case, the parameter allows the function to personalize the greeting by using the value provided during the function call.