Python - Zelle book uses eval(), is it wrong?

后端 未结 5 1402
醉酒成梦
醉酒成梦 2021-01-05 07:47

PLEASE NOTE: This is NOT about the use of eval(), it is about the potential quality (or lack thereof) of a book it is used and taught in. SO already has countless threads ab

5条回答
  •  被撕碎了的回忆
    2021-01-05 08:22

    Well, to combine eval() and input() in such a way creates a rudimentary but possibly very harmful 'shell'. I haven't read the book, but I'd take it with a grain of salt. It's not just bad practice, it implements one deadly combo of functions.

提交回复
热议问题