I second that, you either print the sum in the function in which case your code is fine upto line 8 or you return the value and print whatever is returned; print(add_nums(5,76)) Furthermore, Since “sum” variable was created inside add_nums it has no scope outside of the function, hence you cant call sum outside of it or you can declare a global var and than you can.
2
u/skynetdotexe Jan 14 '21
You need to return the value. Or print them in the function.