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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T02:04:32+00:00 2026-05-13T02:04:32+00:00

I am an dictionary (Dictionary of dictionary) old_dict = { ‘1’:{‘A’:1, ‘check’: 0, ‘AA’:2,

  • 0

I am an dictionary (Dictionary of dictionary)

    old_dict = {
    '1':{'A':1, 'check': 0, 'AA':2, 'AAA':3 , 'status':0},
    '2':{'A':11,'check': 0, 'AA':22, 'AAA':33 ,'status':1},
    '3':{'A':111,'check': 0, 'AA':222, 'AAA':333 ,'status':0},
    '4':{'A':1111,'check': 1, 'AA':2222, 'AAA':3333 ,'status':0},
    }

I Want to get a new dictionary that before[‘check’] != 0 and before[‘status’] != 0
so will be

    new_dict = {
    '1':{'A':1, 'check': 0, 'AA':2, 'AAA':3 , 'status':0},
    '3':{'A':111,'check': 0, 'AA':222, 'AAA':333 ,'status':0},
    }

If it’s a list I did like this

    ouputdata = [d for d in data if d[1] == ' 0' and d[6]==' 0']

I have tried

for field in old_dict.values():
       if field['check'] !=0 and field['status'] != 0
          line = field['A'] + field['AA']+field['AAA']
         #write these line to file

How Make it with dictionary.
Could you help me to make it with dictionary

  • 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-05-13T02:04:32+00:00Added an answer on May 13, 2026 at 2:04 am
    new_dict = {}
    for k, d in old_dict.iteritems():
        if d['check'] == 0 and d['status'] == 0:
            new_dict[k] = d
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building a dictionary and want to limit the number of results the
I am decrypting an old text, and I want a fast algorithm to check
Dictionary cannot have two values with same key. please tell which logic/algorithm being used
Resource dictionary 03-11-2010 10:56 AM | I have two different projects. I linked a
Have Dictionary <Int64, byte> that gets used a lot. I mean in a loop
Say I have a dictionary full of parameters: {speed = 1, intelligence = 3,
This program builds a dictionary out of a list based on what two index
I got a dictionary with 10 arrays and each array got 20 elements. How
Each key in dictionary has list of MANY integers. I need to iterate through
I have a Dictionary where the key and value are both strings. It's possible

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.