Question-158: Which of the following statement is correct for below code snippet?
def totalSalary(salary,hike, bonus=10000): #line 1
total=salary + (salary *hike)/100 + bonus #line 2
return total #line 3
print("!!!!Done with total Salary calculation") #line 4
- Line 2 never be executed, when this function is called.
- Get all Questions and Answer from here
- You need to have paid subscription to access all questions
- Thanks for considering Python Certification Material
Answer: C
Exp:
Not reachable lines
- Lines after return statement would never be reached.
Lines after return statement will never be reached.
#Defining a function with two parameters def totalSalary(salary,hike, bonus=10000): total=salary + (salary *hike)/100 + bonus return total #Below line never be reached. print("!!!!Done with total Salary calculation")
i=0 while(i<10):
You can access to full explanation to question and answer from this page. |