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
  find random numbers that are = to the first 2 number of a list. Frankduc 23 3,049 Apr-05-2023, 07:36 PM
Last Post: Frankduc
  List of random numbers astral_travel 17 2,534 Dec-02-2022, 10:37 PM
Last Post: deanhystad
  Remove numbers from a list menator01 4 1,252 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 1,454 Oct-23-2022, 11:13 PM
Last Post: Pedroski55
  Divide a number by numbers in a list. Wallen 7 7,926 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 2,037 Jan-09-2022, 02:39 AM
Last Post: Python84
  producing numbers out of a list bouraque7878 10 3,625 Nov-12-2021, 09:13 PM
Last Post: jefsummers
  Found input variables with inconsistent numbers of samples: [1000, 200] jenya56 2 2,811 Sep-15-2021, 12:48 PM
Last Post: jenya56
  How to change odd to even numbers in the list? plumberpy 8 3,622 Aug-08-2021, 11:07 AM
Last Post: plumberpy
  How to invoke a function with return statement in list comprehension? maiya 4 2,753 Jul-17-2021, 04:30 PM
Last Post: maiya

Forum Jump:

User Panel Messages

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