Samuel Varghese Samuel Varghese - 6 months ago 29
Python Question

How to take multiple values outputted by a function

Quick question. For example, let's say that a function outputs two variables in python. So outputA and outputB. How do take outputA and do something with it like add outside of the function.


You return a tuple (pair), so use something as

    first, second = example(10)

and then use first to do something with it.