
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to return void from Python function?
Since Python is dynamic-typed and you don't specify a return type when defining a function, then you can return anything with any type, that includes None which is the default return value (when you don't return anything, the function actually returns None at the bottom of function)
Functions like this are called void, and they return None, Python's special object for "nothing".
Also a simple return is equivalent to return None if you want to do it in the middle of function.
- Related Questions & Answers
- Return from void functions in C++
- How to return none from Python function?
- How to return a json object from a Python function?
- How to return an object from a function in Python?
- How to return table from MySQL function?
- How can we return a dictionary from a Python function?
- How can we return a tuple from a Python function?
- How can we return a list from a Python function?
- How to return a JSON object from a Python function in Tkinter?
- How can a Python function return a function?
- How to return variable value from jQuery event function?
- How to return a value from a JavaScript function?
- How to return a string from a JavaScript function?
- How to return an object from a JavaScript function?
- How to return local array from a C++ function?
Advertisements