4 ms·
How do Lua and Go differ from returning a tuple in Python?
by Hamuko 7y ago
How do Lua and Go differ from returning a tuple in Python?
- jstewartmobile 7y ago# python, fn() returns tuple (college, student, type_ofcollege) = fn() # php, fn() returns array list(college, student, type_ofcollege) = fn() # go, fn() returns multiple values college, student, type_ofcollege := fn() # lua, fn() returns multiple values college, student, type_ofcollege = fn()
- __warlord__ 7y agoFor Python, a tuple is not necessary when returning multiple values, you can use the same syntax as lua. Edit: I stand corrected, indeed, Python returns a tuple.