Notice: Undefined offset: 16188764 in /var/www/html/qa-external/qa-external-users.php on line 744
I need help doing argument in python(3) - OnlineGDB Q&A
Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

I need help doing argument in python(3)

+15 votes
asked Jul 26, 2025 by Im0Half0Crazy (220 points)
To cut to the chase is there a way to make an argument in python that works with variables out the function?

Like variables that contain inputs, arrays, and dictionary variables.

1 Answer

0 votes
answered Jul 29, 2025 by Raj Mali (140 points)
data = [1, 2, 3]
config = {"multiplier": 2}

def process(data_list, config_dict):
    return [x * config_dict["multiplier"] for x in data_list]

result = process(data, config)
print(result)
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...