Returning tuple with a single item from a function

You need to explicitly make it a tuple (see the official tutorial):

def returns_tuple_of_one(a):
    return (a, )

Leave a Comment