Question-148: Which of the following statements are correct?
- You can mix both positional and keyword-based arguments.
- Get all Questions and Answer from here
- You need to have paid subscription to access all questions
- Thanks for considering Python Certification Material
Answer: A, B, C
Exp:
Mixing positional and keyword-based arguments
- You can mix both positional and keyword-based arguments.
- Rule: You must always put positional arguments, before keyword-based arguments.
- You must not pass same parameter with argument based and position based in single invocation. This would give error as below.
Exercise-10: Mixing position based and Keyword based Argument passing.
#Defining a function with two parameters def totalSalary(salary,hike, bonus): total=salary + (salary *hike)/100 + bonus print("Your total salary is ", total)
i=0 while(i<10):
You can access to full explanation to question and answer from this page. |