🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: Python Functions: questions with answers

15 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. What does this print? (code)
  2. Q2. What does this print? (code)
  3. Q3. What type is args inside def f(args)?
  4. Q4. What does this print? (code)
  5. Q5. Why is def f(items=[]) risky?
  6. Q6. What does this print? (code)
  7. Q7. What does this print? (code)
  8. Q8. What does this print? (code)
  9. Q9. What does this print? (code)
  10. Q10. What does this print? (code)
  11. Q11. What does this print? (code)
  12. Q12. What does this print? (code)
  13. Q13. What does this print? (code)
  14. Q14. What is the safe way to give a function an optional list parameter?
  15. Q15. What is the difference between print() and return inside a function?