def eight():
return 8
def nine():
return 9
def plus():
print({ } + { }.format(eight(),nine()))
Is this a correct syntax? Can we pass a function inside format function, if i run this code it is not performing anything instead it is coming out with exit code 0. My expected output is
17 //which is 8+9
the output which i am getting is:
Process finished with exit code 0
The plus() function should perform addition of two numbers, i am passing the numbers in the form of functions, whenever I call a function like eight() it should return the number eight. Basically I am performing calculation using functions. Can anyone help me with this? Whether the syntax I used for format is correct or not? And is this the correct way. Thank you
print(eight() + nine())?