List z is as follows
z=[1,2,3,4,5]
You want to see the possibility that the smaller the number, the higher the probability that the number will be drawn.
For example, 1 is 50% Two is 20 percent Three is 15% Four is nine percent 5 is a 6% chance
I'm going to send the selected value to a new list.
I'd appreciate it if you could help me realize the possibility of being chosen with a certain probability
python
Keep it simple,
A list of 100 numbers, 1 for 50, 2 for 20...Make 5 with 6 pieces and mix them with random module shuffle.
You can take the mixed list and cut it into elements 0 through 9 to find the probability, and...And so on and so on. There's a lot of course.
804 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
573 GDB gets version error when attempting to debug with the Presense SDK (IDE)
563 PHP ssh2_scp_send fails to send files as intended
561 Understanding How to Configure Google API Key
558 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.