Ваша программа засчитывает единичный бросок 1 как проигрыш
import random
def turn(min_goal, max_goal):
summ = 0
for i in range(0, min_goal):
randint = random.randint(1, 6)
summ += randint
if (summ >= min_goal) and (summ <= max_goal):
return True
elif summ > max_goal:
break
return False
def get_result(min_goal, max_goal):
min = min_goal
max = max_goal
good = 0
bad = 0
for i in range(1, 5000000):
if turn(min, max):
good += 1
else:
bad += 1
return good / (good + bad)
print(get_result(2, 6))
import pandas as pd
train = pd.DataFrame({
'receipt_id':[1,1,2,2,3,3],
'recipt_dayofweek':[4,4,5,5,6,6],
'recipt_time':['20:20','20:20','12:13','12:13','11:10','11:10'],
'item_name':['Молоко','Хлеб','Масло','Хлеб','Болоко','Хлеб']
})
print(train)
'2020-10-26T21:06:41.142Z\011INFO\011piecestore\011upload started\011{\"Piece ID\": \"AXM2YT6GJVAPK6JHWW7SJT4K34IFS3TONWQNO2TUXR7X36FR23CA\", \"Satellite ID\": \"12EayRS2V1kEsWESU9QMRseFhdxYxKicsiFmxrsLZHeLUtdps3S\", \"Action\": \"PUT\", \"Available Space\": 478335599584}',8,'2020-10-27 00:07:54'