side-effects

Is the use of del bad?

Is the use of del bad? Question: I commonly use del in my code to delete objects: >>> array = [4, 6, 7, ‘hello’, 8] >>> del(array[array.index(‘hello’)]) >>> array [4, 6, 7, 8] >>> But I have heard many people say that the use of del is unpythonic. Is using del bad practice? >>> array …

Total answers: 7

Why are global variables evil?

Why are global variables evil? Question: I’m trying to find out why the use of global is considered to be bad practice in python (and in programming in general). Can somebody explain? Links with more info would also be appreciated. Asked By: LarsVegas || Source Answers: This has nothing to do with Python; global variables …

Total answers: 4