Practice Quiz (30-09-2023)

1.) What will be the output ?

def intro(name , hobby = " reading" ) :
print("Hello my name is " , name)
print ("My hobby is ", hobby )

intro(“XYZ”)

a. Hello my name is XYZ
My hobby is reading
b.) Hello my name is XYZ
My hobby is
c.) Error

2.)What will be the output ?

def intro(name , hobby = " reading" ) :
print("Hello my name is " , name)
print ("My hobby is ", hobby )

intro(“XYZ”, “Swimming”)

a. Hello my name is XYZ
My hobby is reading
b.) Hello my name is XYZ
My hobby is swimming
c.) Error

3.)What will be the output ?

def intro(name = “XYZ” , hobby ) :
print("Hello my name is " , name)
print ("My hobby is ", hobby )

a. Hello my name is XYZ
My hobby is reading
b.) Hello my name is XYZ
My hobby is
c.) Error

Answers for given questions:
1.Ans Hello my name is XYZ
My hobby is reading
2.Ans. Error
3 Ans. error

1 Like
  1. a.) Hello my name is XYZ
    My hobby is reading

  2. None of the optons

o/p : Hello my name is XYZ
My hobby is Swimming

  1. c.) Error
1 Like

correct @shrutibeauty24011994

@mamatha.siddoju for Question 2 correct answer is option B