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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:00:36+00:00 2026-05-28T05:00:36+00:00

I currently have some code in Python where I have entered the values from

  • 0

I currently have some code in Python where I have entered the values from a table:

rules = {   "213" : ( 0.00019, 3.5, 0.00019, 3.5 ),
        "222" : ( 0.00019, 4.0, 0.00019, min( 4.0, 4.1E-8 * dm**3 - 4.1E-5 * dm**2 + 0.017 * dm + 1.35 ) ),
        "223" : ( 0.0003,  4.5, 0.0003,  4.5 ),
        "230" : ( 0.00017, 4.5, 0.00017, 3.3 ),
        "231" : ( 0.00027, 5.5, 0.00027, 5.1E-6 * dm**2 - 0.0057 * dm + 4.6 ),
        "232" : ( 0.00036, 6.0, 0.00036, 7.1E-6 * dm**2 - 0.007 * dm + 5.79 ),
        "239" : ( 0.00017, 4.5, 0.00017, 2.9 ),
        "240" : ( 0.00027, 6.5, 0.00027, 9.1E-6 * dm**2 - 0.01 * dm + 6.9 ),
        "241" : ( 0.00049, 7.0, 0.00049, 3.1E-5 * dm**2 - 0.032 * dm + 8.7 ) }
serialNumber = [ "name" ][ 0 : 3 ]
try:
    return rules[ serialNumber ]

The columns (readings from L-R in the brackets): F1ISO, F0ISO, F1COR, F0COR

What I would like to do, with an input ‘name’ (the name being a combination of numbers and letters and always in the form: 11111A for example, there can be two letters at the end).

I want to be able to split the ‘name’ into the letters and numbers but more importantly I am looking at the first 3 numbers and the letters. With these first three numbers I want to be able to read from the ‘table’ above but the values which are chosen also depend on the letter.

The main rules are:
If the letter is equal to V then the ‘ISO’ values are taken.
Any other combination takes the ‘COR’ values.

Thank you to anyone who can help.

  • 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-28T05:00:37+00:00Added an answer on May 28, 2026 at 5:00 am

    This could be helpful to understand how to get the two parts from your entry

    >>> name =  "11111A"
    >>> ser = name[:3]     # first 3 characters
    >>> code = name[3:]    # rest of chars after the third
    >>> ser
    '111'
    >>> code
    '11A'
    >>>
    

    or maybe:

      >>> code = name[-1]     # last character
      >>> code
      'A'
    

    then, in the same way:

    >>> contents = rules[ser]
    >>> if code == 'V':
    ...     print contents[:2]
    ... else:
    ...     print contents[2:]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have some python code I'd like to port to C++ as it's
I have some Python code that works correctly when I use python.exe to run
I currently have some code that will produce a crash dump when my application
I currently have some code that pulls down a list of users in a
I've been trying to implement unit testing and currently have some code that does
I'm using Zend_Search_Lucene, the PHP port of Java Lucene. I currently have some code
Currently, I have some code as follows template<typename Type> Type* getValue(std::string name, bool tryUseGetter
Currently, I have some basic code to play a simple tone whenever a button
I have this Python code to do this: from struct import pack as _pack
Currently I have some code deleting some temporary files created by my program: #

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.