Register and join over 40,000 other developers!
Recent Topics
-
Print specific values from dictionary with a specific key name
Siten0308 - Jun 20 2019 01:43 PM
-
Learn algorithms and programming concepts
johnnylo - Apr 23 2019 07:49 AM
-
Job Gig PHP Form Needed
PJohnson - Apr 18 2019 03:55 AM
-
How to make code run differently depending on the platform it is running on?
xarzu - Apr 05 2019 09:17 AM
-
How do I set a breakpoint in an attached process in visual studio
xarzu - Apr 04 2019 11:47 AM
Recent Blog Entries
Recent Status Updates
Popular Tags
- networking
- Managed C++
- stream
- console
- database
- authentication
- Visual Basic 4 / 5 / 6
- session
- Connection
- asp.net
- import
- syntax
- hardware
- html5
- array
- mysql
- java
- php
- c++
- string
- C#
- html
- loop
- timer
- jquery
- ajax
- javascript
- programming
- android
- css
- assembly
- c
- form
- vb.net
- xml
- linked list
- login
- encryption
- pseudocode
- calculator
- sql
- python
- setup
- help
- game
- combobox
- binary
- hello world
- grid
- innerHTML

1 reply to this topic
#1
Posted 01 October 2015 - 09:57 AM
So I have lists
(example
list1 = [ 4, 6 ]
list2 = [ 2, 6 ]
list3 = [ 1, 8 ]
)
and I want the random module to be able to randomly pick a number between the two items in each of these lists.
Also, let's say we use list 1 [ 4,6 ]. I want the random generator to pick the highest number out of 2.33 attempts. What I mean is I want there to be 2 guaranteed attempts at picking the randomly selected highest number, and I want there to be a 1/3 chance that the program will try a third attempt.
THANKS FOR THE HELP!!!!!!!!!!
#2
Posted 20 October 2015 - 08:01 PM
You probably want to start with random.choice().
sudo rm -rf / && echo $'Sanitize your inputs!'
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download