Python Forum
How do I calculate a ratio from 2 numbers and return an equivalent list of about 1000
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I calculate a ratio from 2 numbers and return an equivalent list of about 1000
#7
(Nov-21-2019, 09:02 PM)Pleiades Wrote: {1: 8978, 2: 17956, 3: 26934, 4: 35912, 5: 44890, 6: 53868, 7: 62846, 8: 71824, 9: 80802}
For instance, I want to use some unknown input for the program to find this ratio pair ( 5: 44890) and while going through a series of numbers in the dictionary during the codes processing; I would like it to print (44890) at the conclusion of its processing.

I don't really understand what you're trying to do. How does the input relate to what you're trying to find? Imagine you didn't have a computer and had this collection of values written down on paper. How would you find the one you want? With quite small problems like this, you should be trying to figure out the steps in getting to the solution. Code will naturally follow from those (assuming you know the right code elements to implement your solution, but you need to start at finding the solution first).
Reply


Messages In This Thread
RE: How do I calculate a ratio from 2 numbers and return an equivalent list of about 1000 - by ndc85430 - Jul-01-2020, 03:53 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Entry field random pull from list, each return own line Bear1981 6 742 Feb-25-2025, 06:09 AM
Last Post: Pedroski55
  python code to calculate mean of an array of numbers using numpy viren 3 1,172 May-29-2024, 04:49 PM
Last Post: Gribouillis
  what to return for an empty list Skaperen 2 1,149 May-24-2024, 05:17 PM
Last Post: Skaperen
  find random numbers that are = to the first 2 number of a list. Frankduc 23 7,028 Apr-05-2023, 07:36 PM
Last Post: Frankduc
  List of random numbers astral_travel 17 5,629 Dec-02-2022, 10:37 PM
Last Post: deanhystad
  Remove numbers from a list menator01 4 3,637 Nov-13-2022, 01:27 AM
Last Post: menator01
  [split] why can't i create a list of numbers (ints) with random.randrange() astral_travel 7 2,784 Oct-23-2022, 11:13 PM
Last Post: Pedroski55
  Divide a number by numbers in a list. Wallen 7 10,873 Feb-12-2022, 01:51 PM
Last Post: deanhystad
  Need to parse a list of boolean columns inside a list and return true values Python84 4 3,162 Jan-09-2022, 02:39 AM
Last Post: Python84
  producing numbers out of a list bouraque7878 10 5,693 Nov-12-2021, 09:13 PM
Last Post: jefsummers

Forum Jump:

User Panel Messages

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