Untitled

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson
Download our mobile app to listen on the go
Get App

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 (A)</p> Signup and view all the answers

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

<p>def (B)</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 (D)</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. (A)</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 (C)</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 (D)</p> Signup and view all the answers

select which is true for python function.

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

Flashcards are hidden until you start studying

More Like This

Use Quizgecko on...
Browser
Browser