Skip to content

Tag: python-2.7

Redefining python built-in function

I’m working on a python program and the author has written a function that looks like this This seems to work, even though str is a built in function and shouldn’t be used as a variable. What is actually happening here? My guess is str will no longer be usable as a function, but only in the scope …

Using return value inside another function

I have these two functions: and When I run my script, it says that user_channel_number is not defined globally. How can I use user_channel_number inside the delete_events function? Answer Functions can not share their local variables. You can return the value from the first and pass it to the second: Or save …