Skip to content Skip to sidebar Skip to footer

Is The Print() Function In Python Considered A Void Function?

As the title says, is the print() function in python a void function? I thought the print() function returns and prints to screen what is passed into it. Now that I think about it,

Solution 1:

It does not return a value, which is the same as returning None. You won't find it explicitly in the documentation as functions returning None simply omit documenting the return value.


Solution 2:

It doesn't return any value; returns None. you can consider as void

please referReturn Value from print()


Solution 3:

There are no void functions in Python. Functions without explicit return returns None, an object of type NoneType. Try print(type(None)) or print(None.__class__)

print prints to the text stream and doesn't return anything (returns None).

https://docs.python.org/3/library/functions.html#print


Post a Comment for "Is The Print() Function In Python Considered A Void Function?"