What's the difference between `raw_input()` and `input()` in Python 3?

后端 未结 6 1653
执笔经年
执笔经年 2020-11-21 04:19

What is the difference between raw_input() and input() in Python 3?

6条回答
  •  不思量自难忘°
    2020-11-21 04:51

    The difference is that raw_input() does not exist in Python 3.x, while input() does. Actually, the old raw_input() has been renamed to input(), and the old input() is gone, but can easily be simulated by using eval(input()). (Remember that eval() is evil. Try to use safer ways of parsing your input if possible.)

提交回复
热议问题