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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T17:28:58+00:00 2026-06-03T17:28:58+00:00

This might be silly. I cannot figure it out right now. There is a

  • 0

This might be silly. I cannot figure it out right now.

There is a total number (x)

Which needs to be divided equally with (y)

If x is 10,000 and y is 10,

That would mean 10,000 is to be spit between 10.

How to find the starting point as

1 starts at 1 and ends 1,000
2 starts at 1,001 & ends 2,000
3 ..
4 ..
5 ..
  • 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-03T17:29:02+00:00Added an answer on June 3, 2026 at 5:29 pm

    This is really just some simple maths:

    x = 10000
    y = 10
    print([(item, item+(x//y-1)) for item in range(1, x, x//y)])
    

    Gives us:

    [(1, 1000), (1001, 2000), (2001, 3000), (3001, 4000), (4001, 5000), (5001, 6000), (6001, 7000), (7001, 8000), (8001, 9000), (9001, 10000)]
    

    Here we use the range() builtin and a list comprehension.

    This works by using the range() builtin to construct a generator from 1 to below x, taking steps of x divided (integer division, so we don’t get a floating point number) by y.

    We then use a list comprehension to take these values (1, 1001, 2001, ..., 9001) and then put them into tuple pairs, adding (x//y-1) (in this case 999) to the value to get the ending boundary.

    Naturally, if you want to use this in a loop, for example, you would be better off with a generator expression so that it’s evaluated lazily, over a list comprehension. E.g:

    >>> for number, (start, end) in enumerate((item, item+(x//y-1)) for item in range(1, x, x//y)): 
    ...     print(number, "starts at", start, "and ends at", end)
    ... 
    0 starts at 1 and ends at 1000
    1 starts at 1001 and ends at 2000
    2 starts at 2001 and ends at 3000
    3 starts at 3001 and ends at 4000
    4 starts at 4001 and ends at 5000
    5 starts at 5001 and ends at 6000
    6 starts at 6001 and ends at 7000
    7 starts at 7001 and ends at 8000
    8 starts at 8001 and ends at 9000
    9 starts at 9001 and ends at 10000
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This might be really simple, but i cannot figure out the problem with this
This might seem as silly question but I am thinking there might be the
This might be a silly question, but... I've been writing a number of classes
This might be a silly question, but here goes: Is there a standard or
Ok sorry this might seem like a dumb question but I cannot figure this
This might be a silly question, but I want to ask if there is
This might be a silly question but does ARC (automatic reference counting) interact with
This might sound a silly question but I've really spend hours in trying to
Well, this might be a silly problem. I just want a faster implementation of
This might look like a silly question to some, but handling the different types

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.