- 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))
5 Antworten
+ 2
tekee tek
Just write
all_calc(x, y)
+ 1
Super, it worked thank you very much AJ!
+ 1
tekee tek
You should avoid to write repeated code
https://code.sololearn.com/c5TdTFiPsqiw/?ref=app
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.
0
I am using print to call the above function, how can I call the function with out that ?