Identify the following function definitions as void or non-void function.

(i)  def fun():


(ii) def fun():



(iii) def fun():



(iv) def fun():






  • Void functions are those functions that do not return any value or don't have a return statement.
  • Non-void functions always return a value.

Therefore, (i) an (ii) are void functions and (iii) and (iv) are non-void functions.

Go Ad-free
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 14 years. He provides courses for Maths, Science, Social Science, Physics, Chemistry, Computer Science at Teachoo.