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

The Archive Base Latest Questions

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

I have a Dictionary with 5 different doubles in the list. I know the

  • 0

I have a Dictionary with 5 different doubles in the list. I know the order of each item in the List. I am trying to find a one liner piece of code where I can lookup a specific value in my list given the key.

So something like:

double myDbl = myDict["key"][value[3]];

Is something like this possible, I cant find it anywhere. Thanks

  • 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:17:00+00:00Added an answer on June 14, 2026 at 7:17 am

    As others have said, if this is a Dictionary<string, List<double>> you could just use

    double value = myDict["key"][3];
    

    However, this line:

    I know the order of each item in the List.

    makes me think that actually you should restructure your code. If you know that the first item always represents one piece of data (e.g. weight), the next always represents another (e.g. height) etc, then you should just create a new type with those properties. Using a List<double> for this will make the code much harder to maintain… it doesn’t naturally reveal the information about what each value means.

    Once you’ve changed it to, say, a Dictionary<string, Person> you can use:

    double height = myDict["key"].Height;
    

    which is significantly clearer.

    Of course it’s possible that you meant something else by the line I’ve quoted…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a dictionary, user_dict, and create a list for each user value, this
I have information about a bunch of different items. Each item has its own
I have a dictionary with keys and a list attached as value to each
I have (for example) Dictionary of different generic types ( d1, d2, d3, d4
Resource dictionary 03-11-2010 10:56 AM | I have two different projects. I linked a
I need an XML-serializable dictionary. Actually, I now have two quite different programs that
I have a dictionary, with 300 key value pairs, where each of the keys
Should you make one request/response object for each method or should you have one
I have created a dictionary with a number of different bits of information all
Can I have a python dictionary with 2 same keys, but with different elements?

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.