6135 links
  • GuiGui's Show
  • Home
  • Login
  • RSS Feed
  • ATOM Feed
  • Tag cloud
  • Picture wall
  • Daily
Links per page: 20 50 100
 
  • python - What's the difference between raw_input() and input() in python3.x? - Stack Overflow
    « Python 2.7.3 (default, Mar 13 2014, 11:03:55)
    >>> username = input("Username : ")
    Username : guigui
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "<string>", line 1, in <module>
    NameError: name 'guigui' is not defined
    >>> nb = input("Un nombre ? ")
    Un nombre ? 42
    >>> »

    « In Python 2, raw_input() returns a string, and input() tries to run the input as a Python expression.

    Since getting a string was almost always what you wanted, Python 3 does that with input(). As Sven says, if you ever want the old behaviour, eval(input()) works. [...] raw_input() does not exist in Python 3.x »
    July 15, 2015 at 1:00:19 PM UTC - permalink - https://stackoverflow.com/questions/4915361/whats-the-difference-between-raw-input-and-input-in-python3-x
Links per page: 20 50 100
 
Mentions légales identiques à celles de mon blog | CC BY-SA 3.0

Shaarli - The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community