Python Function Set-2

Instruction:-

  • Number of Questions : 25
  • Total Marks : 25
  • Each question carry 1 Marks.
  • No negative marking

  •  

    Results

    #1. What is the output of print(type(print()))?

    #2. Which of these is not a valid function name?

    #3. What is the output?
    def test(a, b):
    print(a, b)
    test(b=5, a=2)

    #4. Function arguments can be:

    #5. Which symbol is used for comments in Python?

    #6. What is recursion?

    #7. The return type of input() is:

    #8. A function without parameters and return value is called:

    #9. What will be printed?
    def f(x=10):
    return x * 2
    print(f())

    #10. Which is the correct way to define a function with two parameters?

    #11. Which function converts string to integer?

    #12. What is the purpose of **kwargs in a function?

    #13. A function can be called:

    #14. Python functions can return:

    #15. If a function has no return, what does it return?

    #16. What happens if you pass wrong number of arguments?

    #17. What is the purpose of functions in Python?

    #18. What is the purpose of indentation in Python functions?

    #19. What does this print?
    def f(a, b=3):
    return a + b
    print(f(2))

    #20. Which of the following can define a function that accepts any number of arguments?

    #21. What is the purpose of *args in a function?

    #22. What does this return?
    def fun(x):
    return x + 1
    print(fun(4))

    #23. Which keyword is used to define a function in Python?

    #24. Where is the scope of a function variable?

    #25. What is the purpose of return?

    Previous
    Finish

    Leave a Comment

    Your email address will not be published. Required fields are marked *