

- 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 can we return a tuple from a Python function?
We can return a tuple from a python function in many ways. For the given tuple, we define a function as shown below.
Example
def foo(): str = "tutorialspoint" x = 30 return (str, x); print foo()
Output
('tutorialspoint', 30)
- Related Questions & Answers
- How can we return a dictionary from a Python function?
- How can we return a list from a Python function?
- How we can use Python Tuple within a Tuple?
- How can a Python function return a function?
- How we can create a dictionary from a given tuple in Python?
- How can we return multiple values from a function in C#?
- How can we return multiple values from a function in C/C++?
- How we can update a Python tuple element value?
- How can we overload a Python function?
- Return a C# tuple from a method
- How can I subtract tuple of tuples from a tuple in Python?
- How do we grep a particular keyword from Python tuple?
- How we can call Python function from MATLAB?
- How to return a json object from a Python function?
- How can we return null from a generic method in C#?
Advertisements