In python, the function can return multiple values in python i.e. you can return multiple values instead of single.
Copy the below python program and execute it to see the program output. I have executed it shared the program output after the program.
1 2 3 4 5 | Example def multiple() : return 1*3 , 2*3 , 3*3 , 4*3 , 5*3 val1, val2, val3, val4, val5 = multiple() print(val1, val2, val3, val4, val5) |
Output
1 | 3 6 9 12 15 |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.