Jump to content

Parameter (computer programming)

From Simple English Wikipedia, the free encyclopedia
Revision as of 09:56, 8 January 2025 by 89.197.81.210 (talk) (I Made a Simplified Page for Parameter (computer programming). I made it as I needed this information, but it was not there, so I wanted to help whoever will need this page in the future)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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.