Answer the question
In order to leave comments, you need to log in
How to pass only 1 argument out of 3?
There are 3 arguments in the function, is it possible to pass 1 desired argument without the other 2 without using None. I want to transfer the message text from 1 function to another and I don't know how to transfer the text.
Answer the question
In order to leave comments, you need to log in
Yes, as long as the parameters you won't pass have default values defined.
If a function asks for three arguments, then it must be passed three arguments.
Either redefine the function or mark arguments as optional or with default values
They would give an example, otherwise it’s not entirely clear what you want ...
You can use partial as an option
from functools import partial
def test(x, y, z):
print(x, y, z)
test1 = partial(test, '', '')
test1(7)
# 7
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question