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

  • Home
  • SEARCH
  • 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 6224261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:38:28+00:00 2026-05-24T08:38:28+00:00

I really need help on this. I tried translating this Perl into Python, but

  • 0

I really need help on this. I tried translating this Perl into Python, but it doesn’t seem to do what I want.

Thanks!

Perl:

@X_max = &MaxValue(@xCoords);
     $maxX = int(10 * $X_max[0]/5);
    @X_min = &MinValue(@xCoords);
    $minX =  int(10 * $X_min[0]/5);
    $rangeX = &Range($minX, $maxX);
    print GRID "X:\t $maxX\t $minX\t\t $rangeX\n";

Python (so far):

_max = max(xCoords) 
max(X) = int(10 * max((X)0/5))
X_min = min(xcoords)
min(X) = int(10 * min((X)0/5))
range(X) = range(min(X), max(X))
print('X:') ('%4s') % min, '%15s' % max, '%25s' % range
  • 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-24T08:38:29+00:00Added an answer on May 24, 2026 at 8:38 am

    The Perl does not look like it’s simply the Python min, max, and range functions. Because MaxValue returns a list of values, which is disregarded in the next step as the code simply takes the first item in the list. So it might be something like this:

    x_max  = max( xcoords );
    maxx   = int( 10 * x_max / 5 );
    x_min  = min( xcoords );
    minx   = int( 10 * x_min / 5 );
    rangex = range( minx, maxx );
    grid.write(  "X:\t{0}\t{1}\t{2}\t{3}".format(minX, maxX, rangeX));
    

    Or even:

    rangex = range( 2 * min( xcoords ), 2 * max( xcoords ));
    

    However, the range seems to indicate that it’s simply a simple variable, perhaps just maxx - minx + 1. So I don’t think Python range will work.

    This is over-complex code, to say the least: 10 * x / 5 <=> 2 * x.

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

Sidebar

Related Questions

Sorry to bother again, but I really need help transforming this Python2 code into
I really need your help. I tried everything but the result is always the
I really need help on this one. I am having a simple login form
I really need your help for this. I am relatively new to programming and
I really need some help with this as I have been trying to fix
I'm a c# noob but I really need a professional's help. I am using
I really need help on this because I lost my hopes to correct the
I really need help getting this query right. I can't share actual table and
I really need help with this. This time 2 days ago, my app was
I need a little help with (probably) something really simple. I want to use

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.