Aug-31-2017, 09:11 AM
Hi everyone,
I'm jumping in at the deep end here (I've literally just started codeacademy).
Basically, I was wondering if you could tell me how to code the following:
I want to input two numbers and have python generate a random number between and including the defined numbers.
E.g input 1 would be 0.3 and input 2 would be 0.6 which would output something like 0.42 or 0.54 etc.
Then, I want the generated number to be usable as a variable in an equation at the end of the script (this I have successfully coded myself).
So in short, I want to generate 5 random numbers from 5 different number ranges which I can then feed in to a separate equation :)
After this, I will look at running the script many times (automatically) and dumping a huge list of numbers out :)
Thanks for your help,
Stuart
I'm jumping in at the deep end here (I've literally just started codeacademy).
Basically, I was wondering if you could tell me how to code the following:
I want to input two numbers and have python generate a random number between and including the defined numbers.
E.g input 1 would be 0.3 and input 2 would be 0.6 which would output something like 0.42 or 0.54 etc.
Then, I want the generated number to be usable as a variable in an equation at the end of the script (this I have successfully coded myself).
So in short, I want to generate 5 random numbers from 5 different number ranges which I can then feed in to a separate equation :)
After this, I will look at running the script many times (automatically) and dumping a huge list of numbers out :)
Thanks for your help,
Stuart