Our website is made possible by displaying online advertisements to our visitors.
Please consider supporting us by disabling your ad blocker.

Responsive image


Parameter (computer programming)

In computer science, parameters are stored names of information that we want to use for a subroutine.[1] These pieces of information, called values, are then passed on to the subroutine to be used as arguments.[1] Then these arguments can affect how the program will run.[2]

Parameter (programming)

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.

  1. 1.0 1.1 "Sequence - Programming constructs - OCR - GCSE Computer Science Revision - OCR".
  2. "What is parameter? - Definition from WhatIs.com". WhatIs.com.

Previous Page Next Page








Responsive image

Responsive image