Skip to content

saving_input_into_list.py #2656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions saving_input_into_list.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ran= int(input("Enter the range of elements you want to store / insert "))
l1=[]
for i in range(ran):
l1.append(input("Enter here "))

print(l1)


"""
program first asks the user how many values they want to enter. Then, using a loop, it lets the user enter that many values one by one.
Each entered value is saved into a list called l1. Once all the values are entered, the program prints the complete list, showing
everything the user typed. It's a beginner-friendly way to learn how to collect multiple inputs and store them for later use.
"""
Loading