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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:03:34+00:00 2026-06-07T23:03:34+00:00

I have a dictionary, named descendDict And it contains 4 keys which are class

  • 0

I have a dictionary, named

descendDict

And it contains 4 keys which are class objects, which have values that are both letters and other class objects.

Now what I’m trying to do is sort through the dictionary, and call out different actions if the value brought up in the dictionary is a class object, or if it is a letter:

for x in descendDict:
    print x, descendDict[x]
        for y in descendDict[x][0]:
            if y != (classObject?):
                #Action
            for x in descendDict:
                for z in descendDict[x][0]:
                    if z != (classObject?):
                        if y == z:
                            dist = 0
                        else:
                            dist = float(nodeDict[y]) + float(nodeDict[z])

In the if statements:

if... != (classObject?):

I am trying to determine whether the variable in the dictionary is, or is not a class object, but i just dont know how to do this.

Here is one the entries:

<__main__.Node instance at 0xb6738> ([<__main__.Node instance at 0xb6710>, 'A', <__main__.Node instance at 0xb6760>], '0.1')

I am sorting through it’s first keys list, but i am trying to figure out if the values in the list are a class object, or a letter.

  • 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-07T23:03:35+00:00Added an answer on June 7, 2026 at 11:03 pm

    Not sure what you mean by “class object” since everything in Python is a first-class object. If you’re trying to figure out if it’s an instance of a specific class you can just use isinstance

    if isinstance(y, someClass):
        # do stuff
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a dictionary named 'score' with keys that are tuples. Each tuple is
Animals is a dictionary class that contains Animal class objects. DictionaryBase implements IDictionaryEnumerator.GetEnumerator() and
I have noticed that, for images, the dictionary ALAssetRepresentation.metadata contains a couple of keys
I have a function in view.py which returns two variables i.e. a dictionary named
I have a bunch of named value parameters in a Dictionary<string, object> , which
I have create a Class named EngDictionary. and Then i define a dictionary in
I have a class named Animations and a resource dictionary named animationResources.xaml on the
Say I have a Dictionary object which contains many instances of an object called
For example I have a class named Temp then I assigned values to it
I have a Resources.xaml file that contains a Storyboard targeted at a control named

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.