PYnative

Python Programming

  • Learn Python
  • Exercises
  • Quizzes
  • Code Editor
  • Tricks
Home » Python » Quizzes » Python Functions Quiz

Python Functions Quiz

Updated on: August 24, 2022 | 31 Comments

This Python Functions Quiz provides Multiple Choice Questions(MCQ) to get familiar with how to create a function, nested functions, and use the function arguments effectively.

Also, Solve Python Functions Exercise.

  • The quiz contains 13 Questions. Solve 8 correct to pass the test.
  • You will have to read all the given answers and click over the correct answer.
  • Read Python functions and Python function arguments for any help.

1. Python function always returns a value

 
 

2. Select which is true for Python function

 
 
 
 

3. Choose the correct function declaration of  fun1() so that we can execute the following function call successfully

fun1(25, 75, 55)
fun1(10, 20)
 
 
 
 

4. What is the output of the following display_person() function call

def display_person(*args):
    for i in args:
        print(i)

display_person(name="Emma", age="25")
 
 
 

5. Given the following function fun1() Please select all the correct function calls

def fun1(name, age):
    print(name, age)
 
 
 

6. What is the output of the following function call

def fun1(num):
    return num + 25

fun1(5)
print(num)
 
 
 

7. What is the output of the add() function call

def add(a, b):
    return a+5, b+5

result = add(3, 2)
print(result)
 
 
 
 

8. What is the output of the following code?

def outer_fun(a, b):
    def inner_fun(c, d):
        return c + d
    return inner_fun(a, b)

res = outer_fun(5, 10)
print(res)
 
 
 

9. Select which true for Python function

 
 
 

10. What is the output of the following function call

def fun1(name, age=20):
    print(name, age)

fun1('Emma', 25)
 
 

11. What is the output of the following display() function call

def display(**kwargs):
    for i in kwargs:
        print(i)

display(emp="Kelly", salary=9000)
 
 
 
 

12. What is the output of the following function call

def outer_fun(a, b):
    def inner_fun(c, d):
        return c + d

    return inner_fun(a, b)
    return a

result = outer_fun(5, 10)
print(result)
 
 
 
 

Loading ... Loading …

Loading

Filed Under: Python, Python Basics, Python Quizzes

Did you find this page helpful? Let others know about it. Sharing helps me continue to create free Python resources.

TweetF  sharein  shareP  Pin

About Vishal

Founder of PYnative.com I am a Python developer and I love to write articles to help developers. Follow me on Twitter. All the best for your future Python endeavors!

Related Tutorial Topics:

Python Python Basics Python Quizzes

Python Exercises and Quizzes

Free coding exercises and quizzes cover Python basics, data structure, data analytics, and more.

  • 15+ Topic-specific Exercises and Quizzes
  • Each Exercise contains 10 questions
  • Each Quiz contains 12-15 MCQ
Exercises
Quizzes

Posted In

Python Python Basics Python Quizzes
TweetF  sharein  shareP  Pin

  Python Quizzes

  • Python Quizzes Home
  • Basic Quiz For Beginners
  • Variables and Data Types Quiz
  • Operators and Expression Quiz
  • Input and Output Quiz
  • Functions Quiz
  • if else and loops Quiz
  • Numbers Quiz
  • String Quiz
  • List Quiz
  • Set Quiz
  • Dictionary Quiz
  • Tuple Quiz
  • File Handling Quiz
  • Random Data Generation Quiz

All Python Topics

Python Basics Python Exercises Python Quizzes Python File Handling Python OOP Python Date and Time Python Random Python Regex Python Pandas Python Databases Python MySQL Python PostgreSQL Python SQLite Python JSON

About PYnative

PYnative.com is for Python lovers. Here, You can get Tutorials, Exercises, and Quizzes to practice and improve your Python skills.

Explore Python

  • Learn Python
  • Python Basics
  • Python Databases
  • Python Exercises
  • Python Quizzes
  • Online Python Code Editor
  • Python Tricks

Follow Us

To get New Python Tutorials, Exercises, and Quizzes

  • Twitter
  • Facebook
  • Sitemap

Legal Stuff

  • About Us
  • Contact Us

We use cookies to improve your experience. While using PYnative, you agree to have read and accepted our Terms Of Use, Cookie Policy, and Privacy Policy.

Copyright © 2018–2023 pynative.com