multiple-return-values

Multiple object returns from method not acting as expected

Multiple object returns from method not acting as expected Question: While playing around with pyautogui I decided to make a method to limit the position of my cursor depending on the size of my monitor, since I was moving my cursor randomy. This is what my first attempt looked like. max_x = 10 max_y = …

Total answers: 2

Is it pythonic for a function to return multiple values?

Is it pythonic for a function to return multiple values? Question: In python, you can have a function return multiple values. Here’s a contrived example: def divide(x, y): quotient = x/y remainder = x % y return quotient, remainder (q, r) = divide(22, 7) This seems very useful, but it looks like it can also …

Total answers: 9