Question-164: What would happen, when you run below program

def totalSalary(salary,hike, bonus=10000):

    total=salary + (salary *hike)/100 + bonus

    return total

    print("!!!!Done with total Salary calculation")

def tax(x):

    tax=x*30/100

    return tax

 

x=80000

y=10

z=10000

totalSalary=totalSalary(x, y, z)

your_tax = tax(totalSalary)

 

  1. This would give error
  2. Get all Questions and Answer from here
  3. You need to have paid subscription to access all questions
  4. Thanks for considering Python Certification Material

 

Answer: D

Exp:

Defining more than one function

#Defining a function with three 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")

 

#another function to calculate tax on total salary

def tax(x):

    tax=x*30/100

    return tax

 

i=0

You can access to full explanation to question and answer from this page.

Why Dont you prepare for Python Certifications and Interview Questions with 250+ Questions and Answer : Check Here

Real Exam Number of Questions: 70 Questions
Real Exam Pass Score: 70%
Time Allotted: 90 minutes to complete exam