Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9076253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:04:12+00:00 2026-06-16T19:04:12+00:00

Im writing a program and I’ve run into an issue where I need the

  • 0

Im writing a program and I’ve run into an issue where I need the program to create lists on its own.

animals = ["cat", "dog", "rat", "horse"]

For example. Then, I want a function that list.appends list.

def append()
    input = input(">>>")
    animals.append(input)

When it does this, I want it to make a new list for the user input that is entered. Is there anyway to do this without having to use file functions?

The ultimate goal is for this function to:

  • Append the list “animals” (Got that part)
  • Then, I want it to create a new list that is unique to the input. The list might be referred to by the user input if at all possible.
  • Lastly, I want this list to be editable by the user Which is easy with list.append. But I need to somehow then be able to refer to this unique list in order to do that.

Hope that clears up some confusion.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T19:04:13+00:00Added an answer on June 16, 2026 at 7:04 pm

    I hope I understood where you are aiming at. I suggest you use a dict of lists:

    animals = {}
    while True:
        print(', '.join(i for i in animals))
        animal = input('Choose an animal, or pick a newe one: ')
        if animal == "":
            break
        item = input('enter item: ')    
        animals.setdefault(animal,[]).append(item)
    
    print(animals)
    
    Choose an animal, or pick a newe one: rat
    enter item: foo
    rat
    Choose an animal, or pick a newe one: dog
    enter item: bar
    rat, dog
    Choose an animal, or pick a newe one: 
    {'rat': ['foo'], 'dog': ['bar']}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a program that handles DBs and writes any changes into ListView for
I'm writing a program about image-processing. I need to store an int square matrix
Im writing a program to pull the meta info from websites. I need to
Im writing a program for homework where I need to validate user input and
Writing a program for a project. I need to use a ListSelectionListener in order
Program Details: I am writing a program for python that will need to look
I'm writing program which translate Pascal to C and need some help. I started
Iam writing a program to call php from xsl but I need to store
Writing a program in which I need to split strings from a struct linked
Im writing a program that should read input via stdin, so I have the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.