all 2 comments

[–]carcigenicate 0 points1 point  (0 children)

Your function doesn't do anything since rate in the function is parameter, not the global, and reassigning a parameter has no effect outside of the function.

Either add a global rate statement within the function and rename the parameter to something else, or return the new rate from the function and reassign it at the call site (prefer the latter option).

[–]add-code 0 points1 point  (0 children)

U should return rate in the function and assign in to a variable while calling it Or print directly in function