About 50 results
Open links in new tab
  1. python - How can I read inputs as numbers? - Stack Overflow

    Dec 8, 2013 · Python 2.x There were two functions to get user input, called input and raw_input. The difference between them is, raw_input doesn't evaluate the data and returns as it is, in string form. …

  2. Python input () function - Stack Overflow

    Nov 11, 2016 · On Python 2, input() attempts to coerce the value to a natural Python value, so if the user inputs [1, 2], input() will return a Python list. This is a bad thing, as you will still need to validate and …

  3. How do I use raw_input in Python 3? - Stack Overflow

    Jun 5, 2009 · I'm learning python as well and found one difference between input() and raw_input(). a = input() will take the user input and put it in the correct type. Eg: if user types 5 then the value in a is …

  4. python - Getting user input - Stack Overflow

    In Python 3, it's just input() - caution : there is an input method in 2.x too, but it eval ()s the input and is therefore evil.

  5. python - How do you use input function along with def function?

    Jun 9, 2015 · Also, are you using Python 3 or 2.7? In python 3 using input() will return a string, and to convert this to an integer, you can call int() around the input() function.

  6. python - What's the simplest way of detecting keyboard input in a ...

    Well, since the date of this question post, a Python library addressed this topic. pynput library, from Moses Palmer, is GREAT to catch keyboard and mouse events in a very simple way.

  7. python - How to read an array of integers from single line of input in ...

    I want to read an array of integers from single line of input in python3. For example: Read this array to a variable/list 1 3 5 7 9 What I have tried arr = input.split(' ') But this does not convert

  8. python - How to allow VS Code to take input from users? - Stack …

    The two settings above should allow you to A) Enter input inside of the integrated terminal and B) Select which python interpreter code-runner should execute easily using existing commands.

  9. python - How do I read from stdin? - Stack Overflow

    How do I read from standard input (stdin)? There's a few ways to do it. sys.stdin is a file-like object on which you can call functions read or readlines if you want to read everything or you want to read …

  10. python - EOF Error occurs when trying to give a user input - Stack …

    Nov 2, 2022 · The program that calls a python script decides how to set up that script's stdin/stdout streams. If you run your code through a terminal/command line, by default the terminal will create a …