A
A
Andrii Programmer2021-02-28 03:09:54
Python
Andrii Programmer, 2021-02-28 03:09:54

How to generate a random number in python but at the same time so that the chance of getting a smaller number is greater than a larger one?

I’ll start with a short story:
as always, I’m talking about *** money in an online casino in a game called crash under the pretext that I found 100% tactics and then a friend tells me you’re a programmer, make all the casino games, wind up your balance and play .. .
I liked the idea and I started to make one other game on python and remembered about the same crash and started doing (a crash game where you bet money and after that the odds start to increase you have time to pick up the odds until it stops growing and you get a bet * on the odds on which you took it) and I made the floor of the program so that the coefficient grew, but for one thing I need to make it generate a number from 1 to 1000 (with a point like 1.5 or 1.34 but not 1.555 no more than two numbers after the point) but so that 1000 is generated every 3000 once a 2-4 times in three games, or 4-7 times in five games, well, I think you understand the logic, please help me I was fussing with this cowpea for two days ...

ps order less often than 1000 well, there 10 is quite rare ... but almost always 1-5

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yupiter7575, 2021-02-28
@NonVer

from random import randint
num = randint(1, 10)
if num < 7:
    num1 = 1
else:
    num1 = 2
print(num1)

A
Andrey Dugin, 2021-02-28
@adugin

numpy.random.multinomial

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question