You need to explicitly make it a tuple (see the official tutorial):
def returns_tuple_of_one(a):
return (a, )
More Related Contents:
- Trying to use a returned value without the other parts of a function [closed]
- How can I return two values from a function in Python?
- Is it pythonic for a function to return multiple values?
- Is it ok to skip “return None”?
- Python function define: A message will prompt up if missing entering an argument
- Function defined correctly?
- How to get the return value from a thread in Python?
- How does swapping of members in tuples (a,b)=(b,a) work internally?
- Python function attributes – uses and abuses [closed]
- Ignore python multiple return value
- How to use a return statement in a for loop?
- How do I create a Python function with optional arguments?
- Which is more preferable to use: lambda functions or nested functions (‘def’)?
- How can I use `return` to get back multiple values from a for loop? Can I put them in a list?
- Forced naming of parameters in Python
- How to timeout function in python, timeout less than a second
- How to call an external program in python and retrieve the output and return code?
- Calling functions from a Tkinter Frame to another
- Import a python module without running it
- Is it possible to change a function’s default parameters in Python?
- How to check whether optional function parameter is set
- Python: function and variable with the same name
- How to apply a function to each sublist of a list in python?
- What do ** (double star/asterisk) and * (star/asterisk) mean in a function call?
- Accessing returned values from a function, by another function
- How do I get the return value when using Python exec on the code object of a function?
- “unpacking” a passed dictionary into the function’s name space in Python?
- Finding Combinations to the provided Sum value
- Best way to return a value from a python script
- Modify global list inside a function