Python Forum
Split a number to list and list sum must be number
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Split a number to list and list sum must be number
#4
The last loop is superfluous. The first loop should range from zero to x+1. The middle loop starts at i and ends at x-i+1. And there will be duplicates that must be culled. Theres got to be a better approach.
Dexty and sunny9495 like this post
Reply


Messages In This Thread
RE: Split a number to list and list sum must be number - by deanhystad - Apr-27-2022, 12:43 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Music Python Script Repeating Number When Saving Facebook Photos ThuanyPK 2 154 May-13-2024, 10:59 PM
Last Post: ebn852_pan
  Strange behavior list of list mmhmjanssen 3 379 May-09-2024, 11:32 AM
Last Post: mmhmjanssen
  intering int number akbarza 1 275 Apr-28-2024, 08:55 AM
Last Post: Gribouillis
Brick Number stored as text with openpyxl CAD79 2 577 Apr-17-2024, 10:17 AM
Last Post: CAD79
  [SOLVED] Pad strings to always get three-digit number? Winfried 2 424 Jan-27-2024, 05:23 PM
Last Post: Winfried
  Prime number detector Mark17 5 898 Nov-27-2023, 12:53 PM
Last Post: deanhystad
  Create X Number of Variables and Assign Data RockBlok 8 1,056 Nov-14-2023, 08:46 AM
Last Post: perfringo
  find the sum of a series of values that equal a number ancorte 1 542 Oct-30-2023, 05:41 AM
Last Post: Gribouillis
  No matter what I do I get back "List indices must be integers or slices, not list" Radical 4 1,305 Sep-24-2023, 05:03 AM
Last Post: deanhystad
  capturing multiline output for number of parameters jss 3 866 Sep-01-2023, 05:42 PM
Last Post: jss

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020