While its possible to evaluate a list like that, it's not good practice as evaluating anything can introduce many edge cases.

A better solution would be to have the user input the values of the list either all at once:

entry = list(input("Enter the values: ").split(","))
# User enters: 1,2,3,4,5
# List ends up as: [1, 2, 3, 4, 5]

or one at a time

endChar = '$' # Setting end character
in = '' # Clearing user input variable
chars = [] # List of values
print("Enter your values, use '$' to finish.") # User prompt
while in != endChar: # Continue until $ is entered
    in = input("Value: ") # Get value
    chars.append(in) # Add element to list
print(chars) # Finished list
Answer from Dan P on Stack Overflow
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-get-a-list-as-input-from-user
Get a list as input from user in Python - GeeksforGeeks
In Python, getting a list as input means a program should prompt the user to enter multiple values during execution, and these values should be captured and stored in a Python list data structure.
Published: September 18, 2025
๐ŸŒ
PYnative
pynative.com โ€บ home โ€บ python โ€บ python take a list as input from a user
Python take a list as input from a user
September 8, 2023 - Enter elements of a list separated ... 10, 15, 20, 25, 30] Sum = 105 ... The Python input() function always converts the user input into a string and then returns it to the calling program....
Discussions

Help with user input into a list
Please format your code for reddit. https://www.reddit.com/r/learnpython/wiki/faq#wiki_how_do_i_format_code.3F You have a good start. But one critical part of a function is that you need to use return to send data back from it. Try like this: def get_input(): item = input("Enter item ") return item def make_list(i): this_list = [] while i > 0: this_list.append(get_input()) i -= 1 return this_list if __name__ == "__main__": num = int(input("Enter number of list items ")) print(make_list(num)) More on reddit.com
๐ŸŒ r/learnpython
10
1
June 17, 2023
python - Get a list of numbers as input from the user - Stack Overflow
How is it not related to "How to ... a list from it? As for the first question, question age is irrelevant by policy (there are many meta Q&As about this; see e.g. meta.stackoverflow.com/questions/251938). Regardless, a proper question should pick an input format to work with, not ask about both. Keeping the question closed helps people find the right canonical for the format they want. ... Save this answer. ... Show activity on this post. In Python 3.x, use ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
How can I create a list based on user input? Like having the user name the list and add what values they want inside the list
This should full fill you needs! checklists = {} def populate_checklist(): n = int(input("\nEnter how many items you want in your list: ")) list = [] for i in range(n): item = input(f"Enter #{i+1} item: ") list.append(item) return list def add_checklist(): print("\n*Main Menu > Creat List") print("Select a tag for you check list:") checklist_tag_choice = ['To do', 'Shopping', 'Inventory', 'Best of', 'Bucket'] for i in range(len(checklist_tag_choice)): print(f"{i+1}. {checklist_tag_choice[i]}") print('6. Go to main menu') checklist_tag = input("\nEnter you choice: ") try: if int(checklist_tag) >= 1 and int(checklist_tag) <= 5: checklist_name = input("Enter unique name to your list: ") checklist_name_list = populate_checklist() for i in range(len(checklist_tag_choice)): if i+1 == int(checklist_tag): unique_listname = str(checklist_name) + ':' + str(checklist_tag_choice[i]) checklists[unique_listname] = checklist_name_list print("Successfully added!\n") goback = input("Enter anything to add more or 'q' to goto main menu: ") if goback == 'q': select_checklists() else: add_checklist() elif checklist_tag == '6': select_checklists() else: print("Wrong choice, try again!") add_checklist() except ValueError: print("Wrong choice, try again!") add_checklist() def select_checklists(): while True: print(f"\n*MAIN MENU\nYou currently have {len(checklists)} items in your check list!\nSelect an option:") print("1. Create list") print("2. Show check list") print("3. Close app") select_list = input("\nEnter you choice: ") if select_list == '1': add_checklist() elif select_list == '2': print('\nYour check list:') print("\nName \t\ Tag \t\ List") for i in checklists: print(f"{i.split(':')[0]} \t\ {i.split(':')[1]} \t\ {checklists[i]}") elif select_list == '3': print("Good bye!") break else: print("Wrong choice, try again!") select_checklists() More on reddit.com
๐ŸŒ r/learnpython
11
1
April 25, 2022
Adding input to a list
mylist = [] mylist.append(input("prompt?")) More on reddit.com
๐ŸŒ r/learnpython
1
2
April 27, 2020
๐ŸŒ
Scaler
scaler.com โ€บ home โ€บ topics โ€บ list input in python
List Input In Python - Scaler Topics
April 4, 2024 - Lists in python are used to store multiple data items (possibly of different types) under a single variable. Generally, to take the user input in python we use the input() function, but when we take list input in python the input() function is used in a slightly different manner.
๐ŸŒ
Edureka
edureka.co โ€บ blog โ€บ input-a-list-in-python
How To Input A List In Python | Python Lists - Edureka
February 13, 2025 - Similar to the above program, we have the ability to create a program in Python to accept a list of strings from the user. Take a look at the example below to understand this better. input_string = input("Enter family members separated by comma ") family_list = input_string.split(",") print("Printing all family member names") for name in family_list: print(name)
๐ŸŒ
Besant Technologies
besanttechnologies.com โ€บ home โ€บ blogs โ€บ general โ€บ how to input a list in python?
How To Input a List in Python | Python Lists | Besant Technologies
October 8, 2021 - It is basically a collection of certain items. These items are separated by the comma (,) and the list is enclosed with the square brackets(). In python, to accept the inputs from the user, you can use input() function.
Find elsewhere
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ python-get-a-list-as-input-from-user
Python Get a list as input from user
July 9, 2020 - numbers = [] # Input number of elements n = int(input("Enter number of elements in the list : ")) # iterating till the range for i in range(0, n): print("Enter element No-{}: ".format(i+1)) elm = int(input()) numbers.append(elm) # adding the element print("The entered list is: \n", numbers)
๐ŸŒ
Javatpoint
javatpoint.com โ€บ input-a-list-in-python
Input a list in Python - Javatpoint
Input a list in Python with Codes in Python with tutorial, tkinter, button, overview, canvas, frame, environment set-up, first python program, etc.
๐ŸŒ
Bobby Hadz
bobbyhadz.com โ€บ blog โ€บ python-add-user-input-to-list
How to take a List from user input in Python | bobbyhadz
Declare a variable that stores an empty list. Use the range() class to loop N times in a for loop. On each iteration, append the input value to the list.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ list-as-input-in-python-in-single-line
List As Input in Python in Single Line - GeeksforGeeks
July 23, 2025 - Python provides several ways to take a list as input in Python in a single line. Taking user input is a common task in Python programming, and when it comes to handling lists, there are several efficient ways to accomplish this in just a single line of code.
๐ŸŒ
Medium
medium.com โ€บ edureka โ€บ input-a-list-in-python-f1f3ae32be9f
How To Input a List in Python? | Edureka
September 25, 2020 - Similar to the above program, we have the ability to create a program in Python to accept a list of strings from the user. Take a look at the example below to understand this better. input_string = input("Enter family members separated by comma ") family_list = input_string.split(",") print("Printing all family member names") for name in family_list: print(name)
๐ŸŒ
Codexpro
codexpro.ai โ€บ blog โ€บ understanding-input-lists-in-python-how-to-efficiently-handle-user-input
Understanding Input Lists in Python: How to Efficiently Handle User Input โ€“ Code {X} Pro
January 17, 2024 - Input lists are a fundamental concept in Python programming that allow efficient handling of user input. A list is a versatile data structure that can hold multiple values, making it suitable for storing and managing user inputs.
๐ŸŒ
Reddit
reddit.com โ€บ r/learnpython โ€บ how can i create a list based on user input? like having the user name the list and add what values they want inside the list
r/learnpython on Reddit: How can I create a list based on user input? Like having the user name the list and add what values they want inside the list
April 25, 2022 -

Iโ€™m working ok a beginner project for my Coding class where Iโ€™m making a checklist, the only part thatโ€™s stopping me from finishing though is creating the actual check list part, how do I get the user to name and create a list (which will be their checklist) and add whatever values they want to it.

Top answer
1 of 4
3
This should full fill you needs! checklists = {} def populate_checklist(): n = int(input("\nEnter how many items you want in your list: ")) list = [] for i in range(n): item = input(f"Enter #{i+1} item: ") list.append(item) return list def add_checklist(): print("\n*Main Menu > Creat List") print("Select a tag for you check list:") checklist_tag_choice = ['To do', 'Shopping', 'Inventory', 'Best of', 'Bucket'] for i in range(len(checklist_tag_choice)): print(f"{i+1}. {checklist_tag_choice[i]}") print('6. Go to main menu') checklist_tag = input("\nEnter you choice: ") try: if int(checklist_tag) >= 1 and int(checklist_tag) <= 5: checklist_name = input("Enter unique name to your list: ") checklist_name_list = populate_checklist() for i in range(len(checklist_tag_choice)): if i+1 == int(checklist_tag): unique_listname = str(checklist_name) + ':' + str(checklist_tag_choice[i]) checklists[unique_listname] = checklist_name_list print("Successfully added!\n") goback = input("Enter anything to add more or 'q' to goto main menu: ") if goback == 'q': select_checklists() else: add_checklist() elif checklist_tag == '6': select_checklists() else: print("Wrong choice, try again!") add_checklist() except ValueError: print("Wrong choice, try again!") add_checklist() def select_checklists(): while True: print(f"\n*MAIN MENU\nYou currently have {len(checklists)} items in your check list!\nSelect an option:") print("1. Create list") print("2. Show check list") print("3. Close app") select_list = input("\nEnter you choice: ") if select_list == '1': add_checklist() elif select_list == '2': print('\nYour check list:') print("\nName \t\ Tag \t\ List") for i in checklists: print(f"{i.split(':')[0]} \t\ {i.split(':')[1]} \t\ {checklists[i]}") elif select_list == '3': print("Good bye!") break else: print("Wrong choice, try again!") select_checklists()
2 of 4
2
Google "Python to do list" and skip all of the examples that create a GUI. You should be able to get an idea of how to do it from that.
๐ŸŒ
PythonForBeginners.com
pythonforbeginners.com โ€บ home โ€บ how to get a list as user input in python
How to Get a List as User Input in Python - PythonForBeginners.com
December 15, 2021 - We can get a list of values using the for loop in python. For this, we can first create an empty list and a count variable. After that, we will ask the user for the total count of values in the list. After getting the total count of values, we can run the input() function count number of times ...
๐ŸŒ
YouTube
youtube.com โ€บ watch
User Input For List | Python Programs - YouTube
In this Python Programming video series we will discuss about how to take user input for list in detail.Here we will see how we can take user input for list ...
Published: November 9, 2020
Views: 107K
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ how-to-input-a-list-in-python-using-for-loop
How to Input a List in Python using For Loop - GeeksforGeeks
July 23, 2025 - Explanation: We are first prompting the user to specify how many elements to enter. Then, the for loop runs n times each time taking input and appending it to the list a. Note: We can modify this code to input integers, floats or other types by using appropriate type casting.
๐ŸŒ
Intellipaat
intellipaat.com โ€บ home โ€บ blog โ€บ how to take list input in python โ€“ python list input
How to Take List Input in Python - Python List Input [Updated]
August 12, 2026 - Check out this YouTube video to learn about Python: List input is a fundamental aspect of Python programming, allowing developers to gather a collection of items, such as numbers, strings, or any other data type, from users or external sources.