About 84,200 results
Open links in new tab
  1. python - Creating if/else statements dependent on user input - Stack ...

    I'm trying to create a simple script that will will ask a question to which the user will input an answer (Or a prompt with selectable answers could appear?), and the program would output a response based on …

  2. How to define default value if empty user input in Python?

    Here I have to set the default value if the user will enter the value from the keyboard. Here is the code that user can enter value: input = int(raw_input("Enter the inputs : ")) Here the value wi...

  3. python - How to put input statement inside a print function? - Stack ...

    Oct 7, 2022 · Python’s print () function comes with a parameter called ‘end‘. By default, the value of this parameter is ‘\n’, i.e. the new line character. We can change it to whatever use-case we have:

  4. Python: How do I put print statement and input on same line?

    Sep 25, 2018 · How can I make it that when the user enters input its on the same line as the print statement like for example for the code snippet below. The output becomes: Enter grade for course …

  5. Python Input function not Working in VS Code - Stack Overflow

    Sep 15, 2021 · When I run the code with the code runner extension the code shows in the terminal however when it gets to the input function it freezes like its asking me to input some data however I …

  6. variables - Two values from one input in python? - Stack Overflow

    This is somewhat of a simple question and I hate to ask it here, but I can't seem the find the answer anywhere else: is it possible to get multiple values from the user in one line of Python? For

  7. How to make user input not case sensitive? - Stack Overflow

    That way, the users need to input which city (files) they want to analyze on which particular month or day. However, I want the user to be able to input something that is not case sensitive.

  8. python - Loop on if-statement to reject invalid input - Stack Overflow

    Apr 30, 2014 · In python is there a way to redo a raw input and if statement if the answer is invalid? So for instance if you ask the user to guess 1 or 2, and they guess 3 you create the additional elif or else...

  9. python - Can I use a variable inside of an input statement? - Stack ...

    Oct 1, 2016 · Can I use a variable inside of an input statement? [duplicate] Asked 9 years, 2 months ago Modified 9 years, 2 months ago Viewed 47k times

  10. How do I put a users input into print in Python - Stack Overflow

    Sep 10, 2015 · Closed 10 years ago. I'm very new to python and I am making a text based game. In the start I ask the users name. How would I add what the user input to when I "print"?