Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Python function which accepts tuple input?

In Python 2, this function definition is valid:

def sv( (L, R) ):
    return L ^ R

However, in Python 3, a syntax error is returned on the second left parenthesis. I can't figure out why?

How do I instruct Python to accept a tuple as input?

like image 913
ColinMac Avatar asked Mar 25 '26 10:03

ColinMac


1 Answers

Tuple parameter unpacking was removed in python 3.

https://www.python.org/dev/peps/pep-3113/

like image 197
Filip Haglund Avatar answered Mar 27 '26 00:03

Filip Haglund



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!