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 8830061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:58:51+00:00 2026-06-14T07:58:51+00:00

In my comp sci class, we’ve just touched on dictionaries. I’m trying to figure

  • 0

In my comp sci class, we’ve just touched on dictionaries. I’m trying to figure out how to remove an item from a list in a dictionary and move it to another list.

For example,

dict1={ 'colors':[red,blue,green], 'sweaters':[mine, his, hers]}

Let’s say I wanted to check if “red” was in the dictionary, and it was. So how could I go about removing it from “colors”, and adding it to “sweaters”? The list part has thrown me off.

This is the function I have thus far( the actual problem)

`def nowRead(yourDict, title):

key1, key2, key3, key4 = yourDict.values() 
if title in key2: 
    key2.remove(title)
    key3.append(title)
return yourDict
  • 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-14T07:58:52+00:00Added an answer on June 14, 2026 at 7:58 am
    for key in dict1.keys():
        if 'red' in dict1[key]:
            theList = dict1[key]
            # remove 'red' from theList
            # append 'red' to another list in dict1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to figure out this problem for one of my comp sci classes,
Trying to figure out a regex for validating a network path ie: \\comp\xyz or
I have to create the sin function from scratch in my Comp Sci class,
I'm in an introductory comp-sci class (after doing web programming for years) and became
I'm trying to obtain the top say, 100 scores from a list of scores
I have a simple question for a Comp Sci class I'm taking where my
Sorry if this is a comp-sci 101 question. I'm just unsure if I'm missing
I am fresh out of College (graduated in December with BS in Comp Sci).
I'm taking a Pre-AP Comp Sci class and figured I join the club and
Lists are immutable in Scala, so I'm trying to figure out how I can

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.