About 33,600,000 results
Open links in new tab
  1. How to Ask for User Input in Python: A Complete Guide

    To ask for user input in Python, use the built-in input() function. For example: name = input("Enter your name: ") print(f"Hello {name}") Output example: Enter your name: Jack Hello Jack. In addition to asking for simple string input like this, you also want to learn how to: Ask for multiple inputs in one go.

  2. Python User Input - W3Schools

    Python allows for user input. That means we are able to ask the user for input. The method is a bit different in Python 3.6 than Python 2.7. Python 3.6 uses the input() method. Python 2.7 uses the raw_input() method. The following example asks for the username, and when you entered the username, it gets printed on the screen:

  3. python - Asking the user for input until they give a valid …

    Apr 25, 2014 · Click is a library for command-line interfaces and it provides functionality for asking a valid response from a user. Simple example: import click number = click.prompt('Please enter a number', type=float) print(number)

  4. How To Ask The User A Question In Python

    Here’s how you How to ask the user a question in Python. But, how will you get to know that python is asking you your name if you haven’t written this code? The program’s user won’t read the program, he/she will just use it like you use your applications and games.

  5. How to Take Continuous Input in Python? - Python Guides

    Jun 18, 2023 · Taking continuous input in Python means that the program keeps asking the user for input until a certain condition is met. This is typically achieved using loops. In this Python tutorial, I will show you an example of how to take continuous input in Python. Let us see, an example of how to ask for user input in Python.

  6. Yes/No question with user input in Python - bobbyhadz

    Apr 9, 2024 · To ask the user a yes/no question: Use the input() function to take input from the user. Perform an action if either condition is met. We used the input() function to take input from the user. The if statement checks if the user entered yes and prints a message.

  7. Ask user to input a correct response in Python? [duplicate]

    I am a newbie programmer and am trying to code a program where I ask the user for a specific input like Obama, Clinton or Bush and congratulate them when they give the right answer or notify them when they give the wrong answer.

  8. Asking Questions: How To Take User Input In Python

    In this article, we are going to see👀 how can you make your python program ask questions to users. How to make python ask questions? How can we take multiple user inputs? How can we take user input in other data types? What is argv and how is it different from user input?

  9. How to Get Valid User Input in Python: A Beginner’s Guide to Asking

    Feb 23, 2025 · Getting valid user input in Python is all about asking, checking, and looping until it’s right. With input() , while loops, and some clever checks like try / except , you can handle anything users throw at you.

  10. Make python ask questions from strings - Stack Overflow

    Mar 16, 2016 · I want to make python ask questions to the user - from random variables in lists. It needs to ask the question requiring an input from the user. This is my code so far: name = input("What is your full name?") How would I make the last line of code ask a question and get an input from the user?

  11. Some results have been removed
Refresh