About 304,000 results
Open links in new tab
  1. 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. Any way to write a prompt that can work for both? @Agostino try: input = raw_input ; …

  2. Python 2.7 getting user input and manipulating as string without ...

    In Python 2 we use the raw_input() function. It waits for the user to type some input and press return and we need to store the value in a variable by casting as our desire data type.

  3. python - Getting a hidden password input - Stack Overflow

    By default, the password input will be fully invisible. If you want to show asterisks in place of the user typed password, use the echo_char parameter added in Python 3.14.

  4. python - User input and command line arguments - Stack Overflow

    634 To read user input you can try the cmd module for easily creating a mini-command line interpreter (with help texts and autocompletion) and raw_input (input for Python 3+) for reading a line of text …

  5. Why do I get "NameError: name '...' is not defined ... - Stack Overflow

    input accepts a string from the user and evaluates the string in the current Python context. When I type dude as input, it finds that dude is bound to the value thefourtheye and so the result of evaluation …

  6. python - Get a list of numbers as input from the user - Stack Overflow

    numbers = input() print(len(numbers)) the input [1,2,3] and 1 2 3 gives a result of 7 and 5 respectively – it seems to interpret the input as if it were a string. Is there any direct way to make a list out of it? …

  7. Command line input in Python - Stack Overflow

    For interactive user input (or piped commands or redirected input) Use raw_input in Python 2.x, and input in Python 3. (These are built in, so you don't need to import anything to use them; you just have …

  8. How to reverse user input in Python - Stack Overflow

    Mar 17, 2015 · I am working on a script that takes the user input and reverses the whole input. for example if the user inputs "London" it will be printed as "nodnol" . I am currently being able to …

  9. How to input matrix (2D list) in Python? - Stack Overflow

    Mar 19, 2019 · The input needs to be in a single size separated by space and the reshape converts the list into shape you want. Here (2,2) resizes the list of 4 elements into 2*2 matrix.

  10. Python - How to take user input and use that in function

    Jun 18, 2016 · I edited my answer, yes, you can take user input and pass it to function. In my answer, I am passing user inputs x and y to the function multiplication. Does that clarify your issue?