About 45,200,000 results
Open links in new tab
  1. python - How to let the user select an input from a finite list ...

    Oct 18, 2021 · One of inquirer's feature is to let users select from a list with the keyboard arrows keys, not requiring them to write their answers. This way you can achieve better UX for your …

  2. Using user input to Select an Option from a List in Python

    Apr 9, 2024 · To use user input to select an option from a list: Construct a message that contains the options. Use the input() function to take user input. Check if the user entered one of the …

  3. Get a list as input from user in Python - GeeksforGeeks

    Dec 5, 2024 · In this article, we will see how to take a list as input from the user using Python. Get list as input Using split() Method. The input() function can be combined with split() to accept …

  4. How to Select Items from a List in Python? - Python Guides

    Oct 1, 2024 · Learn how to select items from a list in Python with various methods, including indexing, slicing, and conditions. Enhance your Python skills with practical examples and tips.

  5. Python users choose from the list | Example code - EyeHunts

    Dec 14, 2021 · Use for loop with enumerate function and take input as an integer value. Using this logic will allow to users choose from the list in Python. Simple example code gives the user to …

  6. Python take a list as input from a user - PYnative

    Sep 8, 2023 · Use an input() function to accept the list elements from a user in the format of a string separated by space. Use the split() function of the string class. Next, the split() method …

  7. 5 Best Ways to Get a List as Input from User in Python

    Mar 11, 2024 · For a Pythonic one-liner approach, you can use a list comprehension combined with input().split() to create a neat single line of code. Here’s an example: Assuming a user …

  8. Python: how to use list as source of selection for user input?

    Feb 10, 2015 · With python's raw_input it is not possible to give a preselected list to the user to choose from. With raw_input we collect raw strings. update: a nice solution is to use the new …

  9. Forcing the user to choose from a set of options (in Python)

    Feb 16, 2019 · Instead of a list, use a set: _EXIT_WORDS = { 'leave', 'stop', 'quit' } Set membership is O(1) whereas list membership is O(n), so it's just a good habit to be in.

  10. Selecting Items From a List in Python - Medium

    Dec 5, 2020 · Creating a list and being able to select items through the list is very important. Selecting items is easy and simple, so let's get started. I have my example list here. If I want to …

Refresh