About 510,000 results
Open links in new tab
  1. python - User input and command line arguments - Stack Overflow

    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 …

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

    Jun 18, 2016 · In Python 2, you should accept user inputs with raw_input(): Check this. x=int(raw_input("Enter first number")) y=int(raw_input("Enter second number")) Please follow a …

  3. How to give jupyter cell standard input in python?

    Jan 23, 2016 · Nothing worked as long as input() was the first line, but after putting some arbitrary statements before the first input(), all of the input()s just started working. So, maybe try a …

  4. 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; …

  5. python - How do I store user input into a list? - Stack Overflow

    Apr 4, 2015 · The prompt "Enter numbers" suggests that the user will enter several numbers on the one line, so split the line and convert each number to an int.

  6. Create a tuple from an input in Python - Stack Overflow

    You could interpret the input as Python literals with ast.literal_eval(): import ast a = ast.literal_eval(input('some text: ')) This function will accept any input that look like Python …

  7. python - How can I read inputs as numbers? - Stack Overflow

    Dec 8, 2013 · Python 2's input function evaluated the received data, converting it to an integer implicitly (read the next section to understand the implication), but Python 3's input function …

  8. python - How to read keyboard input? - Stack Overflow

    Aug 3, 2022 · Non-blocking, multi-threaded example: As blocking on keyboard input (since the input() function blocks) is frequently not what we want to do (we'd frequently like to keep doing …

  9. python - How to read an array of integers from single line of input …

    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 …

  10. User input boolean in python - Stack Overflow

    Feb 15, 2018 · I am trying to have a user input whether or not they like spicy food and the output is supposed to be a boolean but I don't seem to be getting an output with my code below: def …

Refresh