🎧 New: AI-Generated Podcasts Turn your study notes into engaging audio conversations. Learn more

Untitled
10 Questions
6 Views

Untitled

Created by
@SmoothestChalcedony

Podcast Beta

Play an AI-generated podcast conversation about this lesson

Questions and Answers

what will be the output of the following code? def test(name,age=20,gender): print(name,age,gender) test('Akash',25,'Male')

  • Akash Male 25
  • Akash Male
  • Syntax Error (correct)
  • No output
  • what will be the output of the following code? z=lambda x:x*x**5 print(z(6))

  • 30
  • 180
  • 46656 (correct)
  • 46656
  • what will be the output of the following code? def outer_fun(x,y): def inner_fun(m,n): m=6 return m+n return inner_fun(x,y) return x result=outer_fun(15,10) print(result)

  • 15
  • 16 (correct)
  • 6
  • 25
  • lambda is a function in python?

    <p>True</p> Signup and view all the answers

    what is the keyword used to define a function in python?

    <p>def</p> Signup and view all the answers

    what will be the output of the following code? def printval(*args): for i in args: print(i) printval(name="Vijay",age="45")

    <p>TypeError</p> Signup and view all the answers

    what is the purpose of the *args parameter in a function definition?

    <p>to allow the function to accept a variable number of arguments.</p> Signup and view all the answers

    what is the purpose of the return statement in a python function?

    <p>to stop the execution of the function and return a value to the caller</p> Signup and view all the answers

    what will be the output of the following code? def myfunc(x): return lambda y:y*x mytripler=myfunc(5) print(mytripler(10))

    <p>50</p> Signup and view all the answers

    select which is true for python function.

    <p>a function can take an unlimited number of arguments</p> Signup and view all the answers

    More Quizzes Like This

    Lambda Functions in Python
    9 questions
    Python Lambda Functions Quiz
    5 questions
    Python Lambda Functions
    37 questions

    Python Lambda Functions

    VigilantDaffodil1847 avatar
    VigilantDaffodil1847
    Use Quizgecko on...
    Browser
    Browser