Skip to content Skip to sidebar Skip to footer

Python Function Called But Not Returning Value. Should Be Simple

I've got a function: def user_login(m): m = 'user_login function called' return m Calling it with: user_login(message) It should change a string, m, and return the result

Solution 1:

You can't "change the string" - instead, what you should be doing, is assigning the result of the function to your string in the calling scope:

m = user_login('some message')
print m

Post a Comment for "Python Function Called But Not Returning Value. Should Be Simple"