What does ...
Terms and Conditions
What does *p mean in method declaration def my_func(*p) in Python?
It tells interpreter that p is a pointer to some value
It passes argument p by copy, not by value
It means that all changes that happen to p inside the method will be visible from outside of method scope
It means that p may have variable number of values inside of it
This notation allows developers to pass variable number of values into function. In this case p is a list that contains all of them. This method can be called like this, for example,
my_func(1, 2, 3)
Login to learn Python
Read more about
What is a correct term for the following piece of Python syntax: 3 + ...
What is a result of following code block execution: a = b = [1, 2, 3]...
Is it possible to link a Python program to code written in C?...
What will the output of the following statement be? print "%s is awes...
In Python 2, if a class is declared using new-style classes like Child(Base)...
Python packages can be imported from inside a Zip file....
Sign Up Now
Subscribe for future quizzes