You can use x = func()[0]
to return the first value, x = func()[1]
to return the second, and so on.
If you want to get multiple values at a time, use something like x, y = func()[2:4]
.
More Related Contents:
- Find partial tuple in list of tuple
- How function is getting called without defining in python [closed]
- Check if input is empty
- Why does my recursive function return None?
- How to merge lists into a list of tuples?
- What is the syntax rule for having trailing commas in tuple definitions?
- Determine function name from within that function (without using traceback)
- How can I find the number of arguments of a Python function?
- a mutable type inside an immutable container
- Understanding Python’s call-by-object style of passing function arguments
- What is the pythonic way to unpack tuples? [duplicate]
- Python – Passing a function into another function
- Builtin function not working with Spyder
- Python element-wise tuple operations like sum
- Converting a list of tuples into a dict
- Run PowerShell function from Python script
- How is tuple implemented in CPython?
- Do something every x (milli)seconds in pygame
- Find an element in a list of tuples
- Set function signature in Python
- How to convert list of tuples to multiple lists?
- How to execute a function asynchronously every 60 seconds in Python?
- Why do we need tuples in Python (or any immutable data type)?
- What does *tuple and **dict mean in Python? [duplicate]
- Check if two Python functions are equal
- How can I use `return` to get back multiple values from a loop? Can I put them in a list?
- Why does adding a trailing comma after an expression create a tuple?
- What is first class function in Python
- Sort a list of tuples depending on two elements [duplicate]
- Is it ok to skip “return None”?