- 1

How to avoid none in the result of the below code

x = int(input("enter x: ")) y = int(input("enter y: ")) def all_calc(x,y):     print("addition of {} and {} = ".format(x,y),x+y)     print("Subraction of {} from {} = ".format(x,y),x-y)     print("Multiplication of {} and {} = ".format(x,y),x*y)     print("Division of {} and {} = ".format(x,y),x/y) print(all_calc(x,y))

1st Mar 2021, 3:15 AM
tekee tek
tekee tek - avatar
5 Antworten
+ 2
tekee tek Just write all_calc(x, y)
1st Mar 2021, 3:32 AM
A͢J
A͢J - avatar
+ 1
Super, it worked thank you very much AJ!
1st Mar 2021, 3:33 AM
tekee tek
tekee tek - avatar
+ 1
tekee tek You should avoid to write repeated code https://code.sololearn.com/c5TdTFiPsqiw/?ref=app
1st Mar 2021, 3:43 AM
A͢J
A͢J - avatar
0
tekee tek Don't print function again if you have already printed values in that function. //If you print function then it will return None. If you print function and function has return type then value will return otherwise None will return.
1st Mar 2021, 3:26 AM
A͢J
A͢J - avatar
0
I am using print to call the above function, how can I call the function with out that ?
1st Mar 2021, 3:29 AM
tekee tek
tekee tek - avatar