Function Argument | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Function Argument

Can anyone solve this progam what error occurs here.. def print_sum_twice(x, y): print(x + y) print(x + y) e=input("enter 1: ") print (e) r=input("enter 2: ") print (r) print_sum_twice(float(e), float(r))

25th Jan 2019, 1:07 PM
Deep singh Sodhi
Deep singh Sodhi - avatar
3 Answers
+ 3
Did you want to sum up the values twice? Because you're not saying that in your function, you just print out the value of the same x + the same y two times.
25th Jan 2019, 1:23 PM
HonFu
HonFu - avatar
+ 1
I just tested it. It worked fine.
25th Jan 2019, 1:17 PM
James
James - avatar
+ 1
Works as expected.
25th Jan 2019, 1:18 PM
Niush
Niush - avatar