How to write a function calc() such that it can accept two variables | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to write a function calc() such that it can accept two variables

How can I write a function calc() such that it can accept two variables and calculate the addition and subtraction applied to each .and must return both addition and subtraction in a single return call

25th Feb 2021, 4:15 PM
Alnice Williams
Alnice Williams - avatar
3 Answers
+ 1
Thanks but already got the hung of things
25th Feb 2021, 4:33 PM
Alnice Williams
Alnice Williams - avatar
0
Hi! you will need to dial this function yourself. what exactly was the problem? you already have at least some start to work?
25th Feb 2021, 4:19 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
calc = lambda x, y: (x+y, x-y)
25th Feb 2021, 5:28 PM
visph
visph - avatar