raw_input()
和 input()
在 Python 3 中有什么区别?
最佳答案
区别在于 raw_input()
在 Python 3.x 中不存在,而 input()
存在。其实旧的raw_input()
已经改名为input()
了,旧的input()
没了,但是可以很容易模拟通过使用 eval(input())
。 (请记住,eval()
是邪恶的。如果可能,请尝试使用更安全的方法来解析您的输入。)
关于python - Python 3 中的 `raw_input()` 和 `input()` 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4915361/